biogeme.expressions.logit_expressions module¶
Arithmetic expressions accepted by Biogeme: logit
- author:
Michel Bierlaire
- date:
Sat Sep 9 15:28:39 2023
- class biogeme.expressions.logit_expressions.LogLogit(util, av, choice)[source]¶
Bases:
Expression
Expression capturing the logit formula.
It contains one formula for the target alternative, a dict of formula for the availabilities and a dict of formulas for the utilities
- Parameters:
util (dict[int, ExpressionOrNumeric])
av (dict[int, ExpressionOrNumeric] | None)
choice (ExpressionOrNumeric)
-
av:
dict
[int
,Expression
] |None
¶ dict of availability formulas
-
choice:
Expression
¶ expression for the chosen alternative
- deep_flat_copy()[source]¶
Provides a copy of the expression. It is deep in the sense that it generates copies of the children. It is flat in the sense that any MultipleExpression is transformed into the currently selected expression. The flat part is irrelevant for this expression.
- Return type:
- getValue()[source]¶
Warning
This function is deprecated. Use
get_value()
instead.- Return type:
float
- get_value()[source]¶
Evaluates the value of the expression
- Returns:
value of the expression
- Return type:
float
- Raises:
BiogemeError – if the chosen alternative does not correspond to any of the utility functions
BiogemeError – if the chosen alternative does not correspond to any of entry in the availability condition
- logit_choice_avail()[source]¶
Extract a dict with all elementary expressions of a specific type
- Returns:
returns a dict with the variables appearing in the expression the keys being their names.
- Return type:
dict(string:biogeme.expressions.Expression)
- recursive_construct_jax_function(numerically_safe)[source]¶
Generates a JAX-compatible function. This function computes the logit-based probability calculation based on availability and utility values.
- Return type:
Callable
[[Array
,Array
,Array
,Array
],array
]- Returns:
A function that takes parameters, a row of the database, and random draws.
- Parameters:
numerically_safe (bool)