Guide: Prior Calibration from Historical Runs
This guide explains how to derive channel-prior suggestions from historical AMMM results.
What This Guide Covers
Section titled “What This Guide Covers”- Input requirements for the calibration utility
- Current V2 file paths to use
- Practical usage and caveats
Utility script:
python research/prior_calibration/priors_calibration.py --helpRequired Inputs
Section titled “Required Inputs”The utility expects one or more run result directories containing:
20_model_fit/model_summary.csv
It extracts rows where parameter starts with beta_channel[...].
Typical Usage
Section titled “Typical Usage”python research/prior_calibration/priors_calibration.py \ --results-dirs runs/2025-08-01/results runs/2025-09-12/results \ --config-yaml data-config/demo_config.yml \ --dist HalfNormal \ --default-sigma 2.0 \ --out suggested_priors.yml \ --verboseKey flags:
--results-dirs: one or more AMMM results roots.--config-yaml: source of canonical media-channel order.--dist:HalfNormal(default) orNormal.--default-sigma: fallback scale.--out: optional output YAML path.
Output
Section titled “Output”The script prints (and optionally writes) a YAML block suitable for
custom_priors.beta_channel.
Validation Checks
Section titled “Validation Checks”- Ensure all source runs are methodologically comparable.
- Confirm channel ordering matches current
media[].spend_col. - Run prior predictive checks after applying new priors:
10_pre_diagnostics/prior_predictive_check.png10_pre_diagnostics/prior_predictive_summary.csv
Caveats
Section titled “Caveats”- Historical posteriors can encode past bias and misspecification.
- Prior calibration improves plausibility but does not guarantee causal validity.
- Always compare calibrated vs baseline priors with the same dataset.