Quick Start
This page shows the anchored heterogeneous AIRL path. The exit action and absorbing state are not optional bookkeeping; they are the normalizations that make the segment rewards interpretable.
AIRL-Het is accessed through AIRLHetConfig and AIRLHetEstimator. Both the
exit action index and the absorbing state index must be supplied; the estimator
raises an error if either is missing.
from econirl.estimation.adversarial.airl_het import AIRLHetConfig, AIRLHetEstimator
config = AIRLHetConfig(
num_segments=2,
exit_action=2, # index of the anchor action (reward = 0)
absorbing_state=20, # index of the absorbing state (V = 0)
reward_type="linear",
initialization="behavioral_anchor",
max_em_iterations=30,
verbose=True,
)
estimator = AIRLHetEstimator(config=config)
summary = estimator.estimate(
panel=panel,
utility=utility,
problem=problem,
transitions=transitions,
)
Key outputs from the returned EstimationSummary:
Attribute |
Meaning |
|---|---|
|
Concatenated segment reward parameters (all segments, flattened). |
|
Mixture policy (prior-weighted average over segments). |
|
Mixture value function. |
|
Whether the EM loop converged by the tolerance criterion. |
|
Number of EM iterations completed. |
|
Mixture log-likelihood at the final EM iterate. |
|
Estimated prior probability per segment. |
|
Posterior assignment probability per trajectory. |
|
Segment-specific policy arrays. |
|
Segment-specific reward matrices. |
|
Hard segment assignment (argmax of posteriors). |
Initialization
Two initialization schemes are available:
config = AIRLHetConfig(..., initialization="random") # random reward start
config = AIRLHetConfig(..., initialization="behavioral_anchor") # cluster by behavior, invert anchor
behavioral_anchor clusters trajectories by observed action shares, inverts
the anchored soft policy into a starting reward for each cluster, and sets
the initial posteriors accordingly. It typically converges faster than a random
start for the serialized-content setting.
Reward Type
config = AIRLHetConfig(..., reward_type="tabular") # state-action table (S x A parameters per segment)
config = AIRLHetConfig(..., reward_type="linear") # linear features (one theta per segment)
The linear mode uses the feature matrix from the supplied utility object. The tabular mode directly learns an entry per state-action pair and is more flexible but requires a larger sample.