traveler.steps.simple_choice.analytic_share_loss#
- simple_choice.analytic_share_loss(store, *, choosers=None, param=None, target_shares, scale=1.0)[source]#
Compute squared loss between modeled and target shares.
- Parameters:
store (AbstractStore) – Store containing chooser and supporting model data.
choosers (WorkingTable or None, optional) – Choosers to evaluate. When omitted, use the configured table.
param (dict[str, float] or None, optional) – Utility coefficients. When omitted, use the model’s parameters.
target_shares (dict or jax.Array) – Target share for each configured alternative.
scale (float, optional) – Multiplier applied to the summed squared error.
- Returns:
Scalar scaled loss.
- Return type:
jax.Array
- Raises:
ValueError – If target shares have the wrong shape or fall outside
[0, 1].- Warns:
UserWarning – If target shares do not sum to one.