Daily path bid prices

Track the mean and standard deviation of the current bid price for selected paths on each day before departure. A path is an itinerary, which can include more than one leg. This tracer observes its total bid price.

This tracer is available coded in Python as a demonstration, but it is also available as native PassengerSim data (see below).

Collect the data

Load the europa/upe demo and attach the tracer before running it:

import passengersim as pax
from passengersim.tracers.bid_price import PathBidPriceTracer

cfg = pax.Config.from_yaml(pax.demo_network("europa/upe"))
cfg.simulation_controls.num_trials = 1
cfg.simulation_controls.num_samples = 800
cfg.simulation_controls.burn_samples = 50
cfg.simulation_controls.show_progress_bar = False
cfg.db = None
cfg.outputs.reports.clear()
cfg.outputs._write_no_files()
cfg.simulation_controls.collect_path_bid_prices = True

with pax.Simulation(cfg) as sim:
    PathBidPriceTracer(path_ids=[211]).attach(sim)
    summary = sim.run()
table = summary.callback_data["path_bid_prices"]
   ╭─────────────────────────────────────╮                                                                         
   │ licensed for jpn                    │                                                                         
   │ until 2036-11-17 20:12:20+00:00 UTC │                                                                         
   │ maximum 42000 legs in network       │                                                                         
   ╰─────────────────────────────────────╯                                                                         

To enable the same tracer in YAML:

callbacks:
  path_bid_prices:
    parameters:
      path_ids: [211]

Read the results

The columns identify paths. The statistic index level contains the mean (mean), sample standard deviation (std_dev), and observation count (n). A single observation has an undefined sample standard deviation. Statistics pool observations across samples, trials, and workers. The optional priority (default 1) controls the timing of the daily observation.

table.xs("std_dev", level="statistic").head()
path_id 211
days_prior
63 25.703031
62 25.743040
61 25.187360
60 25.474175
59 25.768529
from passengersim.tracers.bid_price import fig_path_bid_prices

fig_path_bid_prices(summary)

Pass std_dev=False for means alone, or raw_df=True for the plotted data.

Note

Results saved by earlier versions of PassengerSim have no n row, and their standard deviation is the average of each trial’s standard deviation, which leaves out the variation between trials. Combining such a result with a new one gives trial-weighted averages without an n row. If the standard deviation matters to you, re-run the simulation. The tracers’ options_version has changed, so a configuration that requires the old version reports an error instead of mixing the two.

Native daily path bid-price history

The example above enabled native path collection with collect_path_bid_prices = True. Inspect the same run’s path history:

summary.path_bid_price_history.xs(211, level="path_id").head()
bid_price_mean bid_price_std_dev augmented_bid_price_mean augmented_bid_price_std_dev n_observations
cabin_code days_prior
Y 0 307.015572 493.182692 307.015572 493.182692 750
1 262.471093 475.658276 262.471093 475.658276 750
2 271.392372 476.554814 271.392372 476.554814 750
3 277.552664 469.776351 277.552664 469.776351 750
4 272.466854 462.194783 272.466854 462.194783 750

This opt-in table is indexed by (path_id, cabin_code, days_prior) and contains bid_price_mean, bid_price_std_dev, augmented_bid_price_mean, augmented_bid_price_std_dev, and a single shared n_observations count. Both prices are recorded together once per retained sample and day, excluding burn-in. No database or tracer is required. Collection is independent of leg collection and uses the same daily recording time. Unobserved means and standard deviations are missing; one observation has an undefined sample standard deviation.

The total is the sum of one-passenger reporting bid prices on the path’s legs, using the specified cabin and the existing finite sold-out reporting convention. The augmented total is the effective threshold for a reference class, selected as the class with the lowest fcst_revenue in that cabin and a finite adjusted fare at the active carrier timeframe. Strict (bp) control requires a positive adjusted fare; loose (bp_loose) control allows zero only when the current total bid price is zero within 1e-9. A zero-clipped class can open under loose control when the total bid price is zero, within the offer check’s equality tolerance. Positive adjusted fares remain eligible even when currently closed: their adjustment still preserves the full markup, whereas clipping destroys that information. Equal decision prices are resolved by booking code. The reference can change across time and samples.

augmented total = total + reference fcst_revenue - reference adjusted_fare_price

The decision price (fcst_revenue) can differ from the price shown to the customer under brand, matrix, or weighted pricing; they coincide under the default lowest-price rule. When no adjustment covers the timeframe, the scalar decision-price fallback is used and the markup is zero.

The adjusted fare is read from the same accessor used by offer checks. This includes hybrid weighting, MR and KI adjustments, the zero floor, and highest-class exemptions. No separate Frat5 markup cache is maintained. Without an adjustment, augmented and total prices are equal. If all classes in a cabin fail the reference-selection rule (for example, after advance-purchase closure), the adjustment is zero; no reference offer exists then. This statistic describes the reference class, not a universal threshold for every fare. Capacity and other availability rules still apply, and sold-out legs retain their finite reporting price rather than the offer-time sentinel. Offer checks treat differences smaller than 1e-9 as equality: bp closes at equality, while bp_loose opens. Apply that same rule when comparing a reference decision price with its augmented threshold.

Only paths of bid-price-controlled carriers (bp or bp_loose) are collected. Leg-controlled carriers are omitted. Cabin groupings are cached until path-class count changes or histories are reset, including trial boundaries; reset histories after changing cabin assignments in place.

Raw paired moments are retained in saved results and merged by observation count across trials and workers. This preserves both between-trial variation and the covariance between leg prices. Disabling collection releases native histories; the summary is None when collection is disabled. Older results without this table remain readable.