biogeme.expressions.log_sampled_logit module¶
Arithmetic expressions accepted by Biogeme: sampled logit.
- class biogeme.expressions.log_sampled_logit.LogSampledLogit(utilities, log_probabilities, choice=0)[source]¶
Bases:
ExpressionLog probability for a sampled multinomial logit model.
This expression is designed for sampling of alternatives. It represents
\[V_0 - \omega_0 - \log \sum_{j \in S} \exp(V_j - \omega_j),\]where alternative
0is the chosen alternative by construction, and \(\omega_j\) is the log of the sampling probability correction stored in the generated database.This replaces a large expanded expression of the form
loglogit( { i: utility_i - log_sampling_probability_i for i in sample }, None, 0, )
by a single expression node with a compact JAX implementation.
- Parameters:
utilities (dict[int, ExpressionOrNumeric])
log_probabilities (dict[int, ExpressionOrNumeric])
choice (ExpressionOrNumeric)
- logit_choice_avail()[source]¶
Return availability structures appearing in this expression.
- Return type:
list[LogitTuple]