Explanation: Core MMM Methodology¶
This document explains the core concepts and techniques used in the Abacus MMM library.
(Placeholder: This section needs content explaining the Bayesian approach, the specific model structure (linear model with transformations), the concept and implementation of geometric adstock, and the concept and implementation of logistic/tanh saturation.)
Bayesian Approach¶
Abacus uses a Bayesian framework (via PyMC) for modelling. This means:
Parameters (like channel effectiveness, adstock decay) are treated as probability distributions, not single point estimates.
Prior beliefs about parameters can be incorporated using prior distributions (see Custom Priors (custom_priors) in the Configuration Guide).
Results are posterior distributions, representing updated beliefs after observing the data. This provides inherent uncertainty quantification (e.g., HDIs).
Core Model Structure¶
The underlying model is typically a linear regression model on the transformed media data:
Where:
y_t: Target variable at timet.alpha: Intercept (baseline).beta_m: Coefficient representing the effectiveness of channelm.f(x_{m, t}): Transformed media variable for channelmat timet. This transformation usually involves applying both adstock and saturation.gamma_c: Coefficient for control variablec.z_{c, t}: Value of control variablecat timet.epsilon_t: Error term, typically assumed to be Normally distributed.
Media Transformations¶
The function f() combines two key concepts:
1. Adstock (Carry-over Effect)¶
Concept: The effect of advertising lingers beyond the initial exposure period. Past spending continues to influence the target variable.
Implementation (Geometric Adstock): Abacus uses a geometric decay model. The adstocked value at time
tis a weighted sum of current and past spend, where weights decay geometrically based on a decay rate parameteralpha. A higheralphameans effects decay faster (shorter memory). Theadstock_max_lagparameter truncates this effect.# Conceptual formula (see core.transformers.geometric_adstock) adstock[t] = x[t] + alpha * adstock[t-1]
Parameter:
alpha(typically Beta distributed, 0 to 1).
2. Saturation (Diminishing Returns)¶
Concept: The effectiveness of advertising diminishes as spend increases. The first pound/dollar spent typically has more impact than the millionth.
Implementation (Logistic/Michaelis-Menten): Abacus applies a saturation function to the adstocked media values.
Logistic: Uses a sigmoid-like curve. Controlled by parameter
lam. Higherlammeans saturation occurs more quickly. (Seecore.transformers.logistic_saturation).Michaelis-Menten: Uses a curve common in enzyme kinetics, also representing diminishing returns. Controlled by parameters
beta(representing the maximum effect, similar to Vmax) andlam(controlling the shape/steepness, similar to Km). (Seecore.transformers.michaelis_menten_saturation).
Parameters:
lam(typically Gamma distributed for Logistic), orbetaandlam(for Michaelis-Menten).
The combination f(x) = saturation(adstock(x)) captures both the delayed and the diminishing effects of media spend.