econirl.LinearCost
- class econirl.LinearCost[source]
Bases:
UtilityLinear cost utility for the Rust bus replacement model.
- Implements the utility specification from Rust (1987):
u(s, a; theta_c, RC) = -theta_c * s * (1-a) - RC * a
Where: - s is the mileage state - a is the action (0=don’t replace, 1=replace) - theta_c is the per-period operating cost coefficient - RC is the replacement cost
When a=0 (don’t replace): u = -theta_c * s (operating cost increases with mileage) When a=1 (replace): u = -RC (pay replacement cost, mileage resets)
- property param_names: list[str]
theta_c (operating cost) and RC (replacement cost).
- Type:
Parameter names
- property param_bounds: tuple[ndarray[tuple[Any, ...], dtype[floating]], ndarray[tuple[Any, ...], dtype[floating]]]
Parameter bounds enforcing non-negativity for theta_c and RC.
- property param_init: ndarray[tuple[Any, ...], dtype[floating]]
Reasonable initial values for optimization.
- matrix(n_states, params, n_actions=2)
Compute utility matrix for all state-action pairs.
- Parameters:
- Returns:
Utility matrix of shape (n_states, n_actions) where result[s, a] = u(s, a; params).
- Return type: