Metadata-Version: 2.4
Name: econirl
Version: 0.0.10
Summary: Behavioral inference. IRL and DDC with standard errors.
Project-URL: Homepage, https://github.com/rawatpranjal/econirl
Project-URL: Documentation, https://econirl.readthedocs.io
Project-URL: Repository, https://github.com/rawatpranjal/econirl
Project-URL: Issues, https://github.com/rawatpranjal/econirl/issues
Author: Pranjal Rawat
License-Expression: MIT
License-File: LICENSE
Keywords: discrete-choice,dynamic-programming,econometrics,inverse-reinforcement-learning,structural-estimation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.10
Requires-Dist: equinox>=0.11
Requires-Dist: gymnasium>=0.29
Requires-Dist: jax>=0.4.30
Requires-Dist: jaxlib>=0.4.30
Requires-Dist: jaxopt>=0.8
Requires-Dist: jinja2>=3.1
Requires-Dist: matplotlib>=3.7
Requires-Dist: numpy>=1.24
Requires-Dist: optax>=0.2
Requires-Dist: optimistix>=0.0.7
Requires-Dist: pandas>=2.0
Requires-Dist: scipy>=1.10
Requires-Dist: tqdm>=4.60
Provides-Extra: dev
Requires-Dist: mypy>=1.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest-timeout>=2.3; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1; extra == 'dev'
Requires-Dist: tomli>=2.0; (python_version < '3.11') and extra == 'dev'
Provides-Extra: docs
Requires-Dist: ipykernel; extra == 'docs'
Requires-Dist: myst-parser>=2.0; extra == 'docs'
Requires-Dist: sphinx-copybutton>=0.5; extra == 'docs'
Requires-Dist: sphinx-rtd-theme>=2.0; extra == 'docs'
Requires-Dist: sphinx>=7.0; extra == 'docs'
Description-Content-Type: text/markdown

# econirl

[![PyPI version](https://img.shields.io/pypi/v/econirl.svg)](https://pypi.org/project/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

```bash
pip install econirl
```

## Quick Start

```python
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:

```text
{'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](https://econirl.readthedocs.io/en/latest/estimators/landscape.html)
for how the methods relate.

Core: NFXP, CCP, TD-CCP, MCE-IRL, Neural MCE-IRL, AIRL (AIRL-1), AIRL-Het (AIRL-2),
and GLADIUS. GLADIUS is the package's neural estimator, the `GLADIUS` class is the
`NeuralGLADIUS` implementation.

Other: NNES, MPEC, UFXP, RHIP, f-IRL, IQ-Learn, and the contrib baselines. These are
available for advanced users and method development.

## Package Surface

The recommended API is sklearn-style:

```python
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
