Skip to content

Untruncation

Untruncation is a part of most revenue management systems. It is a mathematical process whereby we estimate the number of customers there would have been for a particular product, assuming we would have offered the product for sale to all comers. In the cases where we actually did offer the product to all, then there is nothing for this algorithm to do beyond counting our actual sales. However, many times our RM systems will limit the number of customers we actually accept, and our actual sales are "truncated". Untruncation is needed to approximate how many customers were lost.

In PassengerSim, untruncation is included as a step within an RM system, typically within the DCP process before any forecasting or optimization steps.

LegUntruncation

Bases: RmAction

Leg-level demand untruncation action.

This action will untruncate demand on legs using the specified algorithm. It is called only once at the beginning of each sample.

which_data instance-attribute

which_data = which_data

Which data to use for untruncation.

algorithm instance-attribute

algorithm: Literal[
    "em",
    "em_py",
    "none",
    "naive1",
    "naive2",
    "naive3",
    "pd",
    "mfem",
] = algorithm

Untruncation algorithm.

There are several available algorithms:

none applies no untruncation, and assumes that demand was the same as sales. Applying this algorithm is still important even if no detruncation is desired, as PassengerSim tracks historical demand separately from sales and without "none" the historical demand used in forecasting would be zero.

em is an expectation-maximization model.

em_py is an expectation-maximization model implemented in Python. It is slow but useful for educational purposes.

naive1 is not recommended for use.

naive2 is not recommended for use.

naive3 is not recommended for use.

pd is a projection-detruncation model, based on the method developed by Hopperstad and described by Weatherford & Polt.

mfem Multi-Flight Expectation Maximization. Takes into account spill and recapture across multiple departures

initialization_method instance-attribute

initialization_method: Literal["default", "pods"] = (
    initialization_method
)

Method for initializing the EM algorithm.

The default method is to use all available data on the first EM iteration. The pods method is to use only the data from unclosed observations on the first EM iteration.

PathUntruncation

Bases: RmAction

Path-level demand untruncation tool.

which_data instance-attribute

which_data = which_data

Which data to use for untruncation.

algorithm instance-attribute

algorithm = algorithm

Untruncation algorithm.

There are several available algorithms:

none applies no untruncation, and assumes that demand was the same as sales. Applying this algorithm is still important even if no detruncation is desired, as PassengerSim tracks historical demand separately from sales and without "none" the historical demand used in forecasting would be zero.

em is an expectation-maximization model.

em_py is an expectation-maximization model implemented in Python. It is slow but useful for educational purposes.

naive1 is not recommended for use.

naive2 is not recommended for use.

naive3 is not recommended for use.

pd is a projection-detruncation model, based on the method developed by Hopperstad and described by Weatherford & Polt.

mfem Multi-Flight Expectation Maximization. Takes into account spill and recapture across multiple departures

initialization_method instance-attribute

initialization_method = initialization_method

Method for initializing the EM algorithm.

The default method is to use all available data on the first EM iteration. The pods method is to use only the data from unclosed observations on the first EM iteration.