bid_price_history

passengersim.database.common_queries.bid_price_history(cnx: Database, scenario: str, burn_samples: int = 100, weighting: 'equal' | 'capacity' = 'equal') DataFrame[source]

Compute average bid price history over all legs for each carrier.

This query requires that the simulation was run while recording leg details (i.e. with the leg flag set on Config.db.write_items), including bid prices.

Parameters:
cnx : Database

scenario : str

burn_samples : int, default 100

The bid prices will be analyzed ignoring this many samples from the beginning of each trial.

weighting : {'equal', 'capacity'}, default 'equal'

How to weight the bid prices. If ‘equal’, then each leg is weighted equally. If ‘capacity’, then each leg is weighted by its total capacity.

Returns:

pandas.DataFrame – The resulting dataframe is indexed by carrier and days_prior, and has these columns:

  • bid_price_mean: Average bid price across all samples and all legs

  • bid_price_stdev: Sample standard deviation of bid prices across all

    samples and all legs

  • fraction_some_cap: Fraction of all legs across all samples that have

    non-zero capacity available for sale.

  • fraction_zero_cap: Fraction of all legs across all samples that have

    zero capacity available for sale. Bid prices are computed for these legs but are not really meaningful.

  • some_cap_bid_price_mean: Average bid price across all samples and

    all legs conditional on the leg having non-zero capacity.

  • some_cap_bid_price_stdev: Sample standard deviation of bid prices

    across all samples and all legs conditional on the leg having non-zero capacity.