Skip to content

PINstimation

0.2.0Package record

Estimation of the Probability of Informed Trading

0packages depend
3.4Kdownloads / year
–test coverage
13/13flavors OK

Overview

About

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.

Changes in 0.2.0

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 negative timelag values (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 of 1/cls, where cls is the total number of clusters, to each cluster.

Dependency Management

  • **Future Package**: Addressed two concerns related to the future package. The updated code now uses lexical scoping with the local() function to manage the variable .lwbound between parallel function calls, preventing unexpected results. Additionally, the maximum size of futures is no longer set to +Inf upon package loading, leaving this option adjustable by the user.

Documentation

  • Replaced the deprecated @docType package tag with _PACKAGE to 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

CRAN checks
13OK
Slowest check: 14.4 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.2.0
READMEYes · 1,181 wordsVignettesYes · 3 · dynamicNEWSYes · 100% structured · mentions 0.2.0Citation fileNoWebsiteYes
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

3.4K
CRAN downloads in the past year
Rank #13,654 · ~9/day · ~286/mo
Daily download trend is not available in this view yet.
40930 days
85290 days
3.4K1 year
Compare downloads with other packages →
Also on105 r2u3 autocran

Repository

42Stars
7Forks
1Open issues
1Open PRs
5Releases
145Commits
1Commit identities
clustering-analysisexpectation-maximisation-algorithmhierarchical-clusteringinformation-asymmetrymarket-microstructuremaximum-likelihood-estimationmixture-distributionspoisson-distribution
License file reads as GPL-3.0 · 145 commits · Last activity 2025-12-17 · +2.4% stars, 30d
Responsiveness
How these are sampled
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

2025-05-24 · 382026-09-30 · 42
PracticesBeta

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.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (1)
Funding

Funding links: Ko-fi

Docs source (2)
pkgdown

GitHub Pages site last deployed 2022-06-01

CRAN release process (1)
cran-comments.md
Show all practicesHide 1 practice
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
13 external dependencies (excludes base and recommended)

Installing PINstimation adds 51 packages (27 with compiled code, 39 MB of source tarballs). Heaviest: stringi 11 MB, bslib 5.6 MB, sass 2.9 MB.

Depends (1)
R >= 3.5.0
LinkingTo (0)
none
Suggests (2)
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (3)
Author, Maintainer since 0.1.0 (2022), Copyright holder
Author
Contributor · added in 0.2.0
Releases (4)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • 0.2.0Latest
    record
    2025-12-17 · current release · diff ↗ ·
    added 1 export
    ivpin
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • 0.1.2
    record
    2023-03-21 · diff ↗ ·
    added 1 export
    classify_trades
  • 0.1.1
    record
    2022-10-19 · diff ↗ ·
    added 1 export
    pin_bayes
  • 0.1.0
    record
    2022-05-27
  • R
    R 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")
Ghachem, M., Borentain, A., & Ersan, O. (2025). PINstimation: Estimation of the Probability of Informed Trading (Version 0.2.0) [Computer software]. https://doi.org/10.32614/CRAN.package.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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for PINstimation version 0.2.0 [Data set]. HJJB, LLC. Data release v2026-10-23. https://doi.org/10.5281/zenodo.21843040

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.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy