%%{init: {"theme": "dark", "themeVariables": {"fontSize": "32px"}, "flowchart":{"htmlLabels":false}}}%% flowchart LR Experimentation("Experimentation") --> MMM("Media Mix Model") MMM --> Attribution("Attribution") Attribution --> Experimentation
Artificial Intelligence Association of Lithuania - AI Lithuania MeetUp
Introduction MMM
Example: Simulated Use Case
2.1 Data Generating Process
2.2 Model Specification
2.3 Results
References
Media Mix Models (MMM) are used by advertisers to measure the effectiveness of their advertising and provide insights for making future budget allocation decisions.
Media mix models are also used to find the optimal media mix that maximizes the revenue under a budget constraint in the selected time period.
%%{init: {"theme": "dark", "themeVariables": {"fontSize": "32px"}, "flowchart":{"htmlLabels":false}}}%% flowchart LR Experimentation("Experimentation") --> MMM("Media Mix Model") MMM --> Attribution("Attribution") Attribution --> Experimentation
“When an ad channel also impacts the level of another ad channel, using a model like in the baseline above, which simultaneously estimates the impact of all ad channels in one equation, will lead to biased estimates.”
We need to do a causal analysis to define the causal connections (DAG) and fit the model accordingly so that we do not induce biased estimates.
%%{init: {"theme": "dark", "themeVariables": {"fontSize": "28px"}, "flowchart":{"htmlLabels":false}}}%% flowchart LR Prior("Prior") --> Data("Data") Data --> Posterior("Posterior")
\[ y_{t} = \text{intercept} + \sum_{m=1}^{M}\beta_{m}f_{\theta}(x_{m, t}) + \sum_{c=1}^{C}\gamma_{c}z_{c, t} + \varepsilon_{t}, \]
with pm.Model(coords=coords) as self.model:
# --- Priors ---
intercept = pm.Normal(name="intercept", mu=0, sigma=2)
beta_channel = pm.HalfNormal(
name="beta_channel", sigma=2, dims="channel"
)
alpha = pm.Beta(name="alpha", alpha=1, beta=3, dims="channel")
lam = pm.Gamma(name="lam", alpha=3, beta=1, dims="channel")
sigma = pm.HalfNormal(name="sigma", sigma=2)
# --- Parametrization ---
channel_adstock = pm.Deterministic(
name="channel_adstock",
var=geometric_adstock_vectorized(
x=channel_data,
alpha=alpha,
),
dims=("date", "channel"),
)
channel_adstock_saturated = pm.Deterministic(
name="channel_adstock_saturated",
var=logistic_saturation(x=channel_adstock, lam=lam),
dims=("date", "channel"),
)
channel_contributions = pm.Deterministic(
name="channel_contributions",
var=channel_adstock_saturated * beta_channel,
dims=("date", "channel"),
)
mu = intercept + channel_contributions.sum(axis=-1)
# --- Likelihood ---
pm.Normal(
name="likelihood", mu=mu, sigma=sigma, observed=target, dims="date",
)
See pymc-marketing
Original Google’s paper: Bayesian Methods for Media Mix Modeling with Carryover and Shape Effects
PyMC bayesian model details: Media Effect Estimation with PyMC: Adstock, Saturation & Diminishing Returns
Bayesian Media Mix Models: Modelling changes in marketing effectiveness over time
Uber’s Orbit: Bayesian Time-Varying Coefficient Model with Applications to Marketing Mix Modeling