Nonparametric Robust Estimation and Inference Methods
Project description
nprobust
Python implementation of the R package nprobust: Nonparametric Robust Estimation and Inference Methods using Local Polynomial Regression and Kernel Density Estimation.
Description
This package provides tools for data-driven statistical analysis using local polynomial regression and kernel density estimation methods as described in:
- Calonico, Cattaneo and Farrell (2018): "On the Effect of Bias Estimation on Coverage Accuracy in Nonparametric Inference", Journal of the American Statistical Association.
- Calonico, Cattaneo and Farrell (2019): "nprobust: Nonparametric Kernel-Based Estimation and Robust Bias-Corrected Inference", Journal of Statistical Software.
Installation
pip install nprobust .
Or with plotting support:
Main Functions
- lprobust: Local polynomial point estimation and robust bias-corrected inference
- lpbwselect: Bandwidth selection for local polynomial regression
- kdrobust: Kernel density point estimation and robust bias-corrected inference
- kdbwselect: Bandwidth selection for kernel density estimation
- nprobust_plot: Plotting function for estimation results
Basic Usage
import numpy as np
from nprobust import lprobust, lpbwselect, kdrobust, kdbwselect, nprobust_plot
# Generate sample data
np.random.seed(42)
n = 500
x = np.random.uniform(0, 1, n)
y = np.sin(2 * np.pi * x) + np.random.normal(0, 0.5, n)
# Local polynomial regression
result = lprobust(y, x)
result.summary()
# Bandwidth selection
bw = lpbwselect(y, x, bwselect="mse-dpi")
bw.summary()
# Kernel density estimation
kd_result = kdrobust(x)
kd_result.summary()
# Plotting
fig = nprobust_plot(result, title="Local Polynomial Regression")
Parameters
lprobust
y: Response variablex: Independent variableeval: Evaluation points (default: 30 equally spaced points)p: Polynomial order (default: 1)deriv: Order of derivative (default: 0)h: Bandwidth (default: data-driven selection)kernel: Kernel function ('epa', 'uni', 'tri', 'gau')bwselect: Bandwidth selection method ('mse-dpi', 'imse-dpi', etc.)vce: Variance estimator ('nn', 'hc0', 'hc1', 'hc2', 'hc3')
kdrobust
x: Data vectoreval: Evaluation pointsh: Bandwidthkernel: Kernel function ('epa', 'uni', 'gau')bwselect: Bandwidth selection method
References
- Calonico, S., M. D. Cattaneo, and M. H. Farrell (2018). "On the Effect of Bias Estimation on Coverage Accuracy in Nonparametric Inference." Journal of the American Statistical Association 113(522): 767-779.
- Calonico, S., M. D. Cattaneo, and M. H. Farrell (2019). "nprobust: Nonparametric Kernel-Based Estimation and Robust Bias-Corrected Inference." Journal of Statistical Software 91(8): 1-33.
License
GPL-2
Original R Package
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nprobust-0.5.0.tar.gz.
File metadata
- Download URL: nprobust-0.5.0.tar.gz
- Upload date:
- Size: 23.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46afa8e9917adc2041ee52c121843c4a31cdb8435a0060b9aaee94c888b4f23e
|
|
| MD5 |
5ef659dc1bc1297ce10c1bf5ba18d70d
|
|
| BLAKE2b-256 |
0eaaff84beea379c4587a1528efbe88e95b729af42678e7613bb780bfa4feb97
|
Provenance
The following attestation bundles were made for nprobust-0.5.0.tar.gz:
Publisher:
publish.yml on anzonyquispe/nprobust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nprobust-0.5.0.tar.gz -
Subject digest:
46afa8e9917adc2041ee52c121843c4a31cdb8435a0060b9aaee94c888b4f23e - Sigstore transparency entry: 836367988
- Sigstore integration time:
-
Permalink:
anzonyquispe/nprobust@690db44c816b2c7744fb75781473347ff50fe8a9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/anzonyquispe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@690db44c816b2c7744fb75781473347ff50fe8a9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file nprobust-0.5.0-py3-none-any.whl.
File metadata
- Download URL: nprobust-0.5.0-py3-none-any.whl
- Upload date:
- Size: 24.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6d8d08783d42dbafd0c07bc938e8cd88c476267f4d0b5218aedafd647104742
|
|
| MD5 |
101df26c179660429bd6bf3a26858087
|
|
| BLAKE2b-256 |
e45ea77bb40471d6ca28b375acd7b4bd38fbc25c9e07556c8f94739701544457
|
Provenance
The following attestation bundles were made for nprobust-0.5.0-py3-none-any.whl:
Publisher:
publish.yml on anzonyquispe/nprobust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nprobust-0.5.0-py3-none-any.whl -
Subject digest:
b6d8d08783d42dbafd0c07bc938e8cd88c476267f4d0b5218aedafd647104742 - Sigstore transparency entry: 836367993
- Sigstore integration time:
-
Permalink:
anzonyquispe/nprobust@690db44c816b2c7744fb75781473347ff50fe8a9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/anzonyquispe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@690db44c816b2c7744fb75781473347ff50fe8a9 -
Trigger Event:
release
-
Statement type: