Estimation of the Probability of Informed Trading
Overview
A comprehensive bundle of utilities for the estimation of probability of informed trading models: original PIN in Easley and O'Hara (1992) and Easley et al. (1996); Multilayer PIN (MPIN) in Ersan (2016); Adjusted PIN (AdjPIN) in Duarte and Young (2009); and volume-synchronized PIN (VPIN) in Easley et al. (2011, 2012). Implementations of various estimation methods suggested in the literature are included. Additional compelling features comprise posterior probabilities, an implementation of an expectation-maximization (EM) algorithm, and PIN decomposition into layers, and into bad/good components. Versatile data simulation tools, and trade classification algorithms are among the supplementary utilities. The package provides fast, compact, and precise utilities to tackle the sophisticated, error-prone, and time-consuming estimation procedure of informed trading, and this solely using the raw trade-level data.
New Features
- **
ivpin()**: This function implements an improved version of the Volume-Synchronized Probability of Informed Trading (VPIN) based on the work of Ke and Lin (2017). By employing a maximum likelihood estimation,ivpin()enhances the stability of VPIN estimates, especially in cases with small volume buckets or infrequent informed trades. The function captures the information embedded in volume time, generating more consistent and reliable results. It is designed to improve the predictability of flow toxicity in trading environments. - **
classify_trades()** and **aggregate_trades()** now accept negativetimelagvalues (treated as quote *leads*), with updated documentation and examples on how lag/lead quotes are used in the classification algorithms. - **
initials_adjpin()**: Aligned the function, which generates initial parameter sets for the adjusted PIN model, with the algorithm outlined in Ersan and Ghachem (2024).
Show all changes in 0.2.0Hide the rest of the changes in 0.2.0
Updates
- **
adjpin()**: The function now includes the time spent on generating initial parameter sets in the total time displayed in the output. This enhancement provides a more comprehensive view of the time taken for the entire process. - **
initials_adjpin_rnd()**: Updated the implementation for generating random initial parameter sets to align with the algorithm described in Ersan and Ghachem (2024). - **
solve_eqx()**: Enhanced the format and performance of polynomial root calculations within the conditional-maximization steps of the ECM algorithm.
Bugfixes
- **
initials_adjpin_cl()**: Fixed an issue with the calculation of the likelihood value according to the algorithm of Cheng and Lai (2021). - **
detectlayers_eg()**: Corrected the return value to a single number when the number of information days is equal to 1. Previously, it incorrectly returned a vector. - **
mpin_ecm()**: Rectified an issue where observations with zero probability in the E-step of the ECM algorithm were assigned a fixed number of clusters (6). Now, the function assigns a uniform probability of1/cls, whereclsis the total number of clusters, to each cluster.
Dependency Management
- **Future Package**: Addressed two concerns related to the
futurepackage. The updated code now uses lexical scoping with thelocal()function to manage the variable.lwboundbetween parallel function calls, preventing unexpected results. Additionally, the maximum size of futures is no longer set to+Infupon package loading, leaving this option adjustable by the user.
Documentation
- Replaced the deprecated
@docType packagetag with_PACKAGEto ensure proper generation of package documentation. - Documentation now links output objects to their S4 class help pages (e.g.
\link{estimate.adjpin-class}), making it easier to navigate to the corresponding class documentation from function help. - Reduced computation in vignettes to improve build time.
Maintenance
- Updated Authors@R metadata: added contributor Alexandre Borentain and expanded author entries with biographical notes and contact details.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 33 (1 internal)includes a package overview page
- Examples that run
- 100%23 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 70% with a bibliography file
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 35
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
7 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/monty-se/pinstimation on 2026-10-22.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2022-06-01
Show all practicesHide 1 practice
Dependencies
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 0.2.0Latest
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- 0.1.2
- 0.1.1
- 0.1.02022-05-27
- RR 4.2.0 released · 2022-04-22
Package metadata
- First published
- 2022-05-27
- Total releases
- 4 / 4 yrs
- License
- GPL (>= 3) OSI
- Minimum R
- ≥ 3.5.0
- Bundled data
- 1.0 MB / 2 files
- Download size
- 2.4 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("PINstimation")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.