biogeme.model_elements.model_elements module

class biogeme.model_elements.model_elements.ModelElements(expressions, use_jit, database, number_of_draws=None, draws_management=None, user_defined_draws=None, expressions_registry=None)[source]

Bases: object

Container for all key components required to define and estimate a model.

Parameters:
  • expressions (dict[str, Expression]) – Dict of expressions to be evaluated.

  • use_jit (bool)

  • database (Database | None)

  • number_of_draws (int | None)

  • draws_management (DrawsManagement | None)

  • user_defined_draws (dict[str:RandomNumberGeneratorTuple] | None)

  • expressions_registry (ExpressionRegistry)

audit()[source]

Audit the model elements

Return type:

AuditTuple

property database: Database
property formula_names: list[str]
classmethod from_expression_and_weight(log_like, database, use_jit, weight=None, number_of_draws=0, draws_management=None, user_defined_draws=None)[source]

Alternative constructor for two expressions.

Parameters:
  • log_like (Expression) – Expression for the log-likelihood.

  • weight (Expression | None) – Expression for the weight.

  • database (Database) – The database containing data.

  • number_of_draws (int) – Number of Monte Carlo draws.

  • draws_management (DrawsManagement | None) – Optional object managing the draws.

  • use_jit (bool)

  • user_defined_draws (dict[slice(<class 'str'>, <class 'biogeme.draws.native_draws.RandomNumberGeneratorTuple'>, None)] | None)

Return type:

ModelElements

generate_named_output(function_output)[source]

Assigns parameter name to the entries of the gradient and the hessian

Return type:

NamedFunctionOutput

Parameters:

function_output (FunctionOutput)

is_panel()[source]
Return type:

bool

property loglikelihood: Expression | None
property number_of_observations: int
on_database_update(updated_index)[source]

Update the draws object to remain consistent with the new database

Parameters:

updated_index (Index)

property sample_size: int
property weight: Expression | None