RDDENSITY
The rddensity package provides tools for manipulation testing around a cutoff using local polynomial density estimators, bandwidth selection, and density plotting.
rddensity: implements density discontinuity testing.rdbwdensity: implements bandwidth selectors for manipulation testing.rdplotdensity: implements density plots around the cutoff.
See Cattaneo, Jansson and Ma (2018, 2020, 2022, 2024) for references.
Website: https://rdpackages.github.io/.
Source code: https://github.com/rdpackages/rddensity.
Authors
Matias D. Cattaneo, maintainer (matias.d.cattaneo@gmail.com)
Michael Jansson (michael.jansson.berkeley@gmail.com)
Xinwei Ma (xinweima.pku@gmail.com)
Ricardo Masini, Python contributor (ricardo.masini@gmail.com)
Installation
To install/update use pip:
pip install rddensity
Usage
from rddensity import rddensity, rdbwdensity, rdplotdensity
- Replication: rddensity illustration, rdplotdensity illustration, senate data.
Dependencies
- numpy
- pandas
- scipy
- sympy
- plotnine
- lpdensity
References
For overviews and introductions, see the rdpackages website.
Software and Implementation
-
Cattaneo, Jansson and Ma (2018): Manipulation Testing based on Density Discontinuity.
Stata Journal 18(1): 234-261. -
Cattaneo, Jansson and Ma (2022): lpdensity: Local Polynomial Density Estimation and Inference.
Journal of Statistical Software 101(2): 1-25.
Technical and Methodological
-
Cattaneo, Jansson and Ma (2020): Simple Local Polynomial Density Estimators.
Journal of the American Statistical Association 115(531): 1449-1455.
Supplemental appendix. -
Cattaneo, Jansson and Ma (2024): Local Regression Distribution Estimators.
Journal of Econometrics 240(2): 105074.
Supplemental appendix.
Metadata
Release files for rddensity 3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rddensity-3.0.tar.gz | 19.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rddensity-3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.2 kB
Release files / rddensity-3.0.tar.gz
| Download URL | rddensity-3.0.tar.gz |
|---|---|
| Size | 19.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8c48e490e62d42347e0fd5fdddb3c33fe812e07c9bdba2e71d214eb92921dbf7
|
|
BLAKE2b-256 checksum How to use checksums |
82bc4481255a9c40ee800b81f96cafd0d423ced295fcee852855a79d9610e775
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 21, 2026.
Transparency logRelease files / rddensity-3.0-py3-none-any.whl
| Download URL | rddensity-3.0-py3-none-any.whl |
|---|---|
| Size | 20.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9175430dd26956a94ac2811f8ca0963a40939cce2aaf8aa3f9929f05bae26840
|
|
BLAKE2b-256 checksum How to use checksums |
b299c13f08e60287b852dba07952567a92d7efbda9f6aa8006581bb7371e8ee1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 21, 2026.
Transparency log