Skip to content

Explanation: Stage-Gated Workflow

AMMM V2 follows a stage-gated Bayesian workflow. Each stage writes artefacts to a numbered folder, and downstream interpretation is valid only when upstream diagnostics are acceptable.

Conceptual stageFolderPurpose
Stage 000_run_metadata/Problem framing, configuration, provenance, run metadata.
Stage 110_pre_diagnostics/Data checks, stationarity, VIF, transfer entropy, prior predictive checks.
Stage 220_model_fit/Posterior sampling artefacts and posterior parameter summaries.
Stage 330_model_assessment/Posterior predictive fit diagnostics and fit metrics.
Stage 440_decomposition/Attribution-style decomposition and channel performance summaries.
Stage 550_diagnostics/Convergence, calibration, Pareto k, pair plots, residual structure checks.
Stage 660_response_curves/Spend-response curve artefacts by channel.
Stage 770_optimisation/Budget optimisation and scenario planning outputs.
Stage 880_interpretation/Narrative and governance artefacts (including agentic reports when enabled).

AMMM diagnostic gates align with a principled Bayesian workflow interpretation:

  • g1: prior predictive plausibility.
  • g2: R-hat convergence quality.
  • g3: effective sample size adequacy.
  • g4: divergence-free posterior geometry.
  • g5: calibration quality (PIT and coverage).
  • g6: PSIS-LOO reliability (Pareto k).
  • g7: energy geometry review (BFMI-style assessment from energy diagnostics).

These gates support pass/warn/fail reasoning. Machine-readable outputs are especially important for automation.

The most important gate artefacts are:

  • 50_diagnostics/convergence_report.json
    • top-level field: converged
  • 50_diagnostics/calibration_report.json
    • top-level field: well_calibrated
  • 50_diagnostics/pareto_k_summary.json
    • top-level field: ok

These fields allow downstream stages and reporting systems to condition interpretation on diagnostic status.

diagnostics_gating controls operational gate behaviour:

  • strict: halt pipeline on convergence failure.
  • warn: continue execution but surface diagnostic warnings.
  • off: disable gate enforcement.

Current V2 workflow enforces strict halting directly on convergence (converged = false). Other diagnostics are still generated and surfaced for governance.

The intended dependency chain is:

  1. Data and prior checks first.
  2. Posterior fit second.
  3. Convergence and calibration review before business interpretation.
  4. Decomposition/optimisation/reporting consumed under diagnostic context.

If Stage 5 diagnostics are poor, Stage 6–8 outputs should be treated as provisional.

Stage gating helps prevent a common MMM anti-pattern: producing polished business outputs from unstable posterior inference.

The workflow is therefore designed to make quality failures visible, auditable, and difficult to ignore.

Passing all gates indicates computational reliability and model adequacy under assumptions. It does not establish causal identification by itself.