biogeme.expressions.draws module

Arithmetic expressions accepted by Biogeme: draws

Michel Bierlaire Fri Jun 27 2025, 14:41:17

class biogeme.expressions.draws.Draws(name, draw_type='NORMAL', dict_of_distributions=None)[source]

Bases: Elementary

Draws for Monte-Carlo integration

Parameters:
  • name (str)

  • draw_type (str)

  • dict_of_distributions (dict[str, PyMcDistributionFactory] | None)

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:

Draws

property draw_dimension: Dimension
expression_type = 6
recursive_construct_jax_function(numerically_safe)[source]

Generates a function to be used by biogeme_jax. Must be overloaded by each expression :rtype: Callable[[Array, Array, Array, Array], array] :return: the function takes two parameters: the parameters, and one row of the database.

Parameters:

numerically_safe (bool)

Return type:

Callable[[Array, Array, Array, Array], array]

recursive_construct_pymc_model_builder()[source]

Generates recursively a function to be used by PyMc. Must be overloaded by each expression :rtype: PymcModelBuilderType :return: the expression in TensorVariable format, suitable for PyMc

Return type:

PymcModelBuilderType

property safe_draw_id: int

Check the presence of the draw ID before its usage

set_draw_per_individual()[source]
Return type:

None

set_draw_per_observation()[source]
Return type:

None