Skip to main content

Behavioral inference. IRL and DDC with standard errors.

Project description

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
from econirl import NFXP

df = load_rust_bus()

model = NFXP(n_states=90, discount=0.9999, utility="linear_cost")
model.fit(df, state="mileage_bin", action="replaced", id="bus_id")

print(model.params_)

cf = model.counterfactual(RC=4.0)
print(cf.policy[50, 1])

Example output:

{'theta_c': 0.0010028828858836278, 'RC': 3.0722093435989524}
0.05519477716656161

Public Estimator Guides

The public docs describe the supported estimator surface and the current validation scope for each method.

Estimator Best for Public evidence scope
NFXP Exact tabular dynamic discrete choice. Synthetic tabular validation.
CCP / NPL Hotz-Miller and NPL-style tabular DDC. Synthetic tabular validation with support conditions.
MPEC Constrained likelihood formulation. Synthetic constrained-likelihood validation.
NNES Neural value approximation inside NPL. Low- and high-dimensional synthetic validation.
TD-CCP Transition-density-free CCP estimation. Encoded-state finite-theta validation.
MCE-IRL Maximum causal entropy reward-feature matching. Supplied-feature simulation validation.
Deep MCE-IRL Neural reward-map recovery with known transitions. Anchored neural reward-map validation.
AIRL Adversarial state-reward recovery under AIRL assumptions. State-only AIRL validation.
AIRL-Het Anchored adversarial recovery with latent segments. Serialized-content simulation validation.
f-IRL f-divergence state-marginal matching. State-marginal simulation validation.
GLADIUS Neural Q and continuation modeling. Preview diagnostics.
IQ-Learn Inverse soft-Q learning. Preview diagnostics.

Package Surface

The recommended API is sklearn-style:

from econirl import NFXP, CCP, MPEC, NNES, TDCCP, MCEIRL

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

econirl-0.0.5.tar.gz (6.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

econirl-0.0.5-py3-none-any.whl (6.3 MB view details)

Uploaded Python 3

File details

Details for the file econirl-0.0.5.tar.gz.

File metadata

  • Download URL: econirl-0.0.5.tar.gz
  • Upload date:
  • Size: 6.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for econirl-0.0.5.tar.gz
Algorithm Hash digest
SHA256 1216f8cc71ff79c4e2c8ae683109f3930f2040b28a36e4cc52984fd4464c9743
MD5 ac4d1b9475385a0f2648730dc76f79ed
BLAKE2b-256 d9d535a8dac95e7cdae0aedd41f5f7ff6800a23b507f0367aa1872e7092f361f

See more details on using hashes here.

File details

Details for the file econirl-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: econirl-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 6.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for econirl-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d793e4c3daa708bc011252b7db073fda25221a7b1358b45e6f704587a7b4d552
MD5 74054bcccfc95147d98eef7345e492d1
BLAKE2b-256 d8d62d46f422d16ed52c1966ab854de4fd8065994d68bc014b0fbbe38d32259e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page