Marketing Mix Modeling with PyMC
An analytical project exploring marketing attribution, budget allocation and response modelling with Bayesian statistics in PyMC.
Personal learning and demonstration project. It is not a deployment for a real client.
Data
- Spend by channel
- Sales
- Context variables
Model
- Response model
- Bayesian inference (PyMC)
- Contribution by channel
Decision
- Budget scenarios
- Uncertainty
Conceptual diagram of a marketing mix modelling workflow. It will be replaced by a diagram of my own.
Overview
A personal analytical project on marketing mix modelling (MMM): estimating how much each marketing channel contributes to sales and how to allocate the budget. It does not present results from a real business.
Problem and goal
Each advertising platform claims conversions for itself, and the sum usually exceeds actual sales. An MMM works with aggregated data — spend per channel and sales over time — to estimate each channel’s contribution and simulate the effect of changing the budget split.
Methodological approach
A model of this kind describes sales as a function of spend in each channel plus context factors such as seasonality or promotions, and usually includes two ideas: advertising effects last over time and have diminishing returns. Bayesian inference with PyMC makes it possible to express the uncertainty of each parameter and communicate ranges instead of single figures.
I’m happy to walk through the implementation details (engines, models and specific parameters) in a conversation.
Technologies
Python, PyMC and statistical modelling.
Limitations worth knowing
- Correlation is not causation. An MMM estimates associations; only experiments (for example geo or lift tests) can calibrate the causal effect.
- Correlated channels. If two channels are switched on together, the model struggles to separate their effects.
- Little data. With short series or little variation in spend, uncertainty is large.
- Structural changes. Launches, crises or price changes alter the learned relationships.
Results and evaluation
Only validated quantitative results will be published. Until validation (fit, predictive checks and sensitivity analysis) is documented, this project is presented as a methodological exploration, with no impact figures.
Relation to services
This line of work applies to advanced analytics and predictive models, always with an honest assessment of what the data allows you to conclude.