Technical methodology

MMM Formula and Calculation Guide

How MixPilot moves from weekly business data to contribution, ROI, uncertainty, diagnostics, and budget recommendations.

Raw weekly data Adstock Saturation Model fit Contribution ROI Optimization
01

Weekly input frame

sales_t, spend_channel_t, controls_t, geo_t

Each row represents one time period, usually a week. Sales or revenue is the outcome. Media spend, pricing, promotions, holidays, distribution, stockouts, geo, and population become explanatory variables.

02

Geometric adstock

adstock_t = spend_t + decay * adstock_(t-1)

Adstock captures carryover. A channel with higher decay keeps influencing future weeks for longer. Search may decay quickly; TV or video may decay more slowly.

03

Hill saturation

response = x^alpha / (x^alpha + gamma^alpha)

Saturation captures diminishing returns. After spend reaches a high level, each extra euro produces less incremental outcome than the euro before it.

04

Preview regression

log(1 + sales) = intercept + media_effects + controls

The local preview model fits transformed media and business controls using positive ridge regression. It is fast and directional, not the final production truth.

05

Ridge penalty

loss = prediction_error + lambda * sum(beta^2)

The penalty stabilizes coefficients when channels move together. It reduces extreme estimates caused by noisy or correlated marketing data.

06

Bayesian production model

sales_t ~ baseline_t + media_t + controls_t + error_t

Meridian and PyMC-Marketing estimate distributions, not just one coefficient. Priors and observed data combine into posterior estimates for contribution, ROI, and uncertainty.

07

Channel contribution

contribution = prediction_with_channel - prediction_without_channel

The model compares expected outcome with the channel active against a counterfactual where that channel is set to zero.

08

Average ROI

ROI = incremental_outcome / spend

Average ROI explains what the channel returned historically. It should not be the only number used for future budget movement.

09

Marginal ROI

mROI = delta_outcome / delta_spend

Marginal ROI estimates the return from the next euro. Budget decisions should prioritize marginal ROI because saturated channels may have strong average ROI but weak next-euro returns.

10

Credible intervals

CI = posterior quantiles, usually 5% to 95%

Credible intervals show uncertainty around contribution, ROI, and marginal ROI. Wider intervals mean recommendations need more caution or validation.

11

Calibration prior

calibrated_roi = model_roi * (1 - w) + experiment_roi * w

Lift tests, geo experiments, and platform incrementality studies can pull model estimates toward observed causal evidence. The weight depends on confidence and test quality.

12

Budget recommendation

recommended_spend = current_spend * (1 + shift)

Spend shifts are based on marginal ROI, channel constraints, minimums, maximums, fixed commitments, and whether the channel can realistically scale.

13

Holdout validation

MAPE = mean(abs(actual - predicted) / actual)

Holdout validation tests whether the model predicts unseen weeks well enough to trust planning outputs.

14

Baseline decomposition

baseline = expected outcome without paid media

Baseline includes demand that would likely happen without paid marketing, such as brand equity, seasonality, distribution, pricing, and organic demand.

15

Negative baseline check

P(baseline < 0)

A high probability of negative baseline is a warning sign. It usually means the model is over-crediting media or missing important controls.

16

Sensitivity analysis

compare outputs across model candidates

Robust recommendations should remain directionally stable across reasonable adstock, saturation, prior, control, and geo specifications.