Quick Start
from econirl.datasets import load_rust_bus
from econirl import UFXP
df = load_rust_bus()
model = UFXP(n_states=90, discount=0.9999, utility="linear_cost")
model.fit(df, state="mileage_bin", action="replaced", id="bus_id")
print(model.params_) # {"theta_c": ..., "RC": ...}
print(model.se_) # standard errors (optimal weighting)
print(model.summary())
Fitted attributes follow the same convention as NFXP and CCP:
Attribute |
Meaning |
|---|---|
|
Estimated parameters by name. |
|
Standard errors from the efficient moment variance. |
|
Coefficients as a numpy array. |
|
Log-likelihood evaluated at the estimate. |
|
Choice probabilities P(a given s), shape (n_states, n_actions). |
|
Value function V(s), shape (n_states,). |
|
Whether the closed-form solve had full rank. |
Weighting Modes
model = UFXP(n_states=90, weights="optimal") # default: efficient, with SEs
model = UFXP(n_states=90, weights="random", # plain random projections
num_projections=64) # consistent, no SEs
The default optimal weighting is the one to use; the random-projection mode is the paper’s baseline construction and is kept for comparison.
Lower-Level Control
The underlying UFXPEstimator accepts a Panel and an explicit utility
specification, problem definition, and transition tensor, mirroring the other
low-level estimators:
from econirl.estimation import UFXPEstimator
result = UFXPEstimator().estimate(panel, utility, problem, transitions)