biogeme.expressions.montecarlo module

Arithmetic expressions accepted by Biogeme: Monte-Carlo integration

Michel Bierlaire Thu Apr 24 2025, 18:47:01

class biogeme.expressions.montecarlo.MonteCarlo(child)[source]

Bases: UnaryOperator

Monte Carlo integration

Parameters:

child (ExpressionOrNumeric)

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:

MonteCarlo

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 In PyMC, the MonteCarlo integration must not be performed. It will be handled by the Gibbs sampling. :rtype: PymcModelBuilderType :return: the expression in TensorVariable format, suitable for PyMc

Return type:

PymcModelBuilderType