Cross-nested logit
Implements the probability generating function and the CDF of a cross-nested logit model
biogeme.cnl module
Implements the probability generating function and the CDF of a cross-nested logit model. This module is not used by Biogeme itself. It is essentially used for external use. It has been mainly implemented to verify the analytical derivatives of these functions.
- author:
Michel Bierlaire
- date:
Fri Apr 22 09:39:49 2022
- biogeme.cnl.cnl_CDF(alternatives, nests)[source]
Cumulative distribution function and its derivatives
- Parameters:
alternatives (
list
[int
]) – a list of alternatives in a given order. In principle, the alternative ids should be integers (to be consistent with Biogeme), but it may be actually be any object for this specific function.nests (
NestsForCrossNestedLogit
) – a tuple containing as many items as nests.
- Return type:
Callable
[[ndarray
],tuple
[float
,ndarray
,ndarray
]]- Returns:
function that calculates the CDF, and its first and second derivatives.
- biogeme.cnl.cnl_G(alternatives, nests)[source]
Probability generating function and its derivatives
- Parameters:
alternatives (
list
[int
]) – a list of alternatives in a given order. In principle, the alternative ids should be integers (to be consistent with Biogeme), but it may be actually be any object for this specific function.nests (
NestsForCrossNestedLogit
) – the object describing the nests.
- Returns:
function that calculates the G function, and its first and second derivatives.
- Return type:
f, g, H = fct(np.array(float))