econirl
Structural dynamic discrete choice and inverse reinforcement learning in Python.
EconIRL helps estimate forward-looking choice models, recover reward functions, and evaluate counterfactual policies from panel data.
Documentation: https://econirl.readthedocs.io/
Install
pip install econirl
Quick Start
from econirl.datasets import load_rust_bus, rust_bus_reward_spec
from econirl import NFXP
df = load_rust_bus()
model = NFXP(n_states=90, discount=0.9999, utility=rust_bus_reward_spec(90))
model.fit(df, state="mileage_bin", action="replaced", id="bus_id")
print(model.params_)
cf = model.counterfactual(replacement_cost=4.0)
print(cf.policy[50, 1])
Example output:
{'operating_cost': 0.001002924937407198, 'replacement_cost': 3.072263682263484}
0.055196266692073837
Public Estimator Guides
The public docs split the estimators into a core roster and the rest. NFXP is the reference within the core, the exact estimator we replicate to Rust (1987) Table IX. See Choosing an Estimator for how the methods relate.
Core: NFXP, CCP, MCE-IRL, Neural MCE-IRL, AIRL, NeuralAIRL, and GLADIUS. GLADIUS
is the package's neural estimator, the GLADIUS class is the
NeuralGLADIUS implementation.
Other: TD-CCP, AIRL2, and every other implemented estimator outside Core. See the exhaustive Other Estimators list.
Package Surface
The recommended API is sklearn-style:
from econirl import NFXP, CCP, NNES, TDCCP, MCEIRL, RHIP, AIRL, GLADIUS
Additional estimators and lower-level configuration objects are available under
econirl.estimation, econirl.estimators, and econirl.contrib for advanced
workflows.
Repository Layout
src/econirl/: package source.tests/: unit, integration, and validation-evidence tests.docs/: public Read the Docs source.validation/: reproducible validation runners and machine-readable results.examples/: public examples and notebooks.
Manuscripts, PDFs, local research workspaces, and assistant-specific notes are not tracked in this public package repository.
License
MIT
Metadata
Release files for econirl 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| econirl-0.1.1.tar.gz | 6.5 MB | Without provenance | Details for econirl-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| econirl-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for econirl-0.1.1-py3-none-any.whl |
Total release size: 12.9 MB
Release files / econirl-0.1.1.tar.gz
| Download URL | econirl-0.1.1.tar.gz |
|---|---|
| Size | 6.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e27b0b3290076f2e19f8e344c6e978b58fdb13567825de79f8dd6875e60f0bcf
|
|
BLAKE2b-256 checksum How to use checksums |
7db9a57b3ab5c66a1eea00f5eb267d8d346ad13c7e2a44da7b049784243c6c24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.12
|
Release files / econirl-0.1.1-py3-none-any.whl
| Download URL | econirl-0.1.1-py3-none-any.whl |
|---|---|
| Size | 6.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ffda3b40b4ac7c1f51210dc7b2dbb1ce933d0ec51e6466edd8dbe8415dde47d
|
|
BLAKE2b-256 checksum How to use checksums |
e90970fdb681a53e71a2a51f02bc03a7305cf88f19699880912e55130763c321
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.12
|
Security for econirl 0.1.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.