biogeme.models.ordered module

Implements various models.

author:

Michel Bierlaire

date:

Fri Mar 29 17:13:14 2019

biogeme.models.ordered.ordered_likelihood(continuous_value, list_of_discrete_values, tau_parameter, cdf)[source]
Ordered model that maps a continuous quantity with a list of

discrete intervals (often logit or probit)

Example: discrete values = [1, 2, 3, 4]

We define thresholds tau_1_2, tau_2_3 and tau_3_4. In order to impose that the threshold are sorted, we actually define

tau_1_2 = tau_parameter tau_2_3 = tau_1_2 + diff2 tau_3_4 = tau_2_3 + diff3

The probability that the discrete value is 2, say, is the probability that the continuous value lies between tau_1_2 and tau_2_3, where the probability distribution is logistic.

Parameters:
  • continuous_value (Expression) – continuous quantity to mapping

  • list_of_discrete_values (list[int]) – discrete values

  • tau_parameter (Beta) – parameter for the first threshold

  • cdf (Callable[[Expression], Expression]) – function calculating the CDF of the random variable

Return type:

dict[int, Expression]

Returns:

dict where the keys are the discrete values and the values are the corresponding probability.

biogeme.models.ordered.ordered_logit(continuous_value, list_of_discrete_values, tau_parameter)[source]
Ordered logit model that maps a continuous quantity with a

list of discrete intervals

Example: discrete values = [1, 2, 3, 4]

We define thresholds tau_1_2, tau_2_3 and tau_3_4. In order to impose that the threshold are sorted, we actually define

tau_1_2 = tau_parameter tau_2_3 = tau_1_2 + diff2 tau_3_4 = tau_2_3 + diff3

The probability that the discrete value is 2, say, is the probability that the continuous value lies between tau_1_2 and tau_2_3, where the probability distribution is logistic.

Parameters:
  • continuous_value (Expression) – continuous quantity to mapping

  • list_of_discrete_values (list[int]) – discrete values

  • tau_parameter (Beta) – parameter for the first threshold

Return type:

dict[int, Expression]

biogeme.models.ordered.ordered_probit(continuous_value, list_of_discrete_values, tau_parameter)[source]
Ordered probit model that maps a continuous quantity with a

list of discrete intervals

Example: discrete values = [1, 2, 3, 4]

We define thresholds tau_1_2, tau_2_3 and tau_3_4. In order to impose that the threshold are sorted, we actually define

tau_1_2 = tau_parameter tau_2_3 = tau_1_2 + diff2 tau_3_4 = tau_2_3 + diff3

The probability that the discrete value is 2, say, is the probability that the continuous value lies between tau_1_2 and tau_2_3, where the probability distribution is normal.

Parameters:
  • continuous_value (Expression) – continuous quantity to mapping

  • list_of_discrete_values (list[int]) – discrete values

  • tau_parameter (Beta) – parameter for the first threshold

Return type:

dict[int, Expression]