biogeme.sampling_of_alternatives.generate_model module¶
Generation of models estimated with samples of alternatives
- author:
Michel Bierlaire
- date:
Fri Sep 22 12:14:59 2023
- class biogeme.sampling_of_alternatives.generate_model.GenerateModel(context)[source]¶
Bases:
objectClass in charge of generating the biogeme expression for the loglikelihood function
- Parameters:
context (SamplingContext)
- generate_utility(prefix, suffix)[source]¶
Generate the utility function for one alternative
- Parameters:
prefix (
str) – prefix to add to the attributessuffix (
str) – suffix to add to the attributes
- Return type:
- get_cross_nested_logit()[source]¶
Returns the expression for the log likelihood of the nested logit model
- Return type:
- get_nested_logit(nests)[source]¶
Returns the expression for the log likelihood of the nested logit model
- Parameters:
nests (
NestsForNestedLogit) – A tuple containing as many items as nests. Each item is also a tuple containing two items:- Return type:
an object of type biogeme.expressions.expr.Expression representing the nest parameter,
a list containing the list of identifiers of the alternatives belonging to the nest.
Example:
nesta = MUA ,[1, 2, 3] nestb = MUB ,[4, 5, 6] nests = nesta, nestb