Skip to content

Choice Models

ChoiceModel module-attribute

ChoiceModel = Annotated[
    PodsChoiceModel | LogitChoiceModel,
    Field(discriminator="kind"),
]

Two types of choice models are available in PassengerSim.

Use the kind key to select which kind of choice model you wish to parameterize.

LogitChoiceModel

Bases: Named

Source code in passengersim/config/choice_model.py
class LogitChoiceModel(Named, extra="forbid"):
    kind: Literal["logit"]

    intercept: float = 0
    """This is the alternative specific constant for the no-purchase alternative."""

    nonstop: float = 0
    duration: float = 0
    price: float = 0
    """This is the parameter for the price of each alternative."""

    tod_sin2p: float = 0
    r"""Schedule parameter.

    If $t$ is departure time (in minutes after midnight local time) divided
    by 1440, this parameter is multiplied by $sin( 2 \pi t)$ and the result is
    added to the utility of the particular alternative."""

    tod_sin4p: float = 0
    r"""Schedule parameter.

    If $t$ is departure time (in minutes after midnight local time) divided
    by 1440, this parameter is multiplied by $sin( 4 \pi t)$ and the result is
    added to the utility of the particular alternative."""

    tod_sin6p: float = 0
    tod_cos2p: float = 0
    tod_cos4p: float = 0
    tod_cos6p: float = 0
    free_bag: float = 0
    early_boarding: float = 0
    same_day_change: float = 0

duration class-attribute instance-attribute

duration: float = 0

early_boarding class-attribute instance-attribute

early_boarding: float = 0

free_bag class-attribute instance-attribute

free_bag: float = 0

intercept class-attribute instance-attribute

intercept: float = 0

This is the alternative specific constant for the no-purchase alternative.

kind instance-attribute

kind: Literal['logit']

nonstop class-attribute instance-attribute

nonstop: float = 0

price class-attribute instance-attribute

price: float = 0

This is the parameter for the price of each alternative.

same_day_change class-attribute instance-attribute

same_day_change: float = 0

tod_cos2p class-attribute instance-attribute

tod_cos2p: float = 0

tod_cos4p class-attribute instance-attribute

tod_cos4p: float = 0

tod_cos6p class-attribute instance-attribute

tod_cos6p: float = 0

tod_sin2p class-attribute instance-attribute

tod_sin2p: float = 0

Schedule parameter.

If \(t\) is departure time (in minutes after midnight local time) divided by 1440, this parameter is multiplied by \(sin( 2 \pi t)\) and the result is added to the utility of the particular alternative.

tod_sin4p class-attribute instance-attribute

tod_sin4p: float = 0

Schedule parameter.

If \(t\) is departure time (in minutes after midnight local time) divided by 1440, this parameter is multiplied by \(sin( 4 \pi t)\) and the result is added to the utility of the particular alternative.

tod_sin6p class-attribute instance-attribute

tod_sin6p: float = 0

PodsChoiceModel

Bases: Named

Source code in passengersim/config/choice_model.py
class PodsChoiceModel(Named, extra="forbid"):
    kind: Literal["pods"]

    emult: float | None = None

    basefare_mult: float | None = None
    connect_disutility: float | None = None
    path_quality: tuple[float, float] | None = None
    preferred_airline: tuple[float, float] | None = None
    r1: float | None = None
    r2: float | None = None
    r3: float | None = None
    r4: float | None = None
    tolerance: float | None = None
    non_stop_multiplier: float | None = None
    connection_multiplier: float | None = None

basefare_mult class-attribute instance-attribute

basefare_mult: float | None = None

connect_disutility class-attribute instance-attribute

connect_disutility: float | None = None

connection_multiplier class-attribute instance-attribute

connection_multiplier: float | None = None

emult class-attribute instance-attribute

emult: float | None = None

kind instance-attribute

kind: Literal['pods']

non_stop_multiplier class-attribute instance-attribute

non_stop_multiplier: float | None = None

path_quality class-attribute instance-attribute

path_quality: tuple[float, float] | None = None

preferred_airline class-attribute instance-attribute

preferred_airline: tuple[float, float] | None = None

r1 class-attribute instance-attribute

r1: float | None = None

r2 class-attribute instance-attribute

r2: float | None = None

r3 class-attribute instance-attribute

r3: float | None = None

r4 class-attribute instance-attribute

r4: float | None = None

tolerance class-attribute instance-attribute

tolerance: float | None = None