Quick Start
This is the smallest UFXP path: fit the unnested structural estimator and read the same kind of reward, policy, and value objects as NFXP or CCP. The shortcut depends on empirical choice-probability support.
from econirl.datasets import load_rust_bus, rust_bus_reward_spec
from econirl import UFXP
df = load_rust_bus()
model = UFXP(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_) # {"operating_cost": ..., "replacement_cost": ...}
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.
Full Estimator API
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)