Build Your Own MMM Platform with PyMC-Marketing
Open-source notebooks showing how to build Marketing Mix Modeling components from scratch using PyMC-Marketing.
These notebooks are companion materials for the Simba MMM documentation. Each notebook teaches a core concept with hands-on code, visualizations, and practical guidance.
Learning Path
Foundation (Start Here)
| # | Notebook | What You’ll Learn | Docs Link |
|---|---|---|---|
| 01 | Data Quality Checklist | Validate your data before modeling: missing values, multicollinearity, outliers, frequency checks | Data Validation |
| 02 | Smart Priors from Data | Auto-generate informed priors from your data characteristics | Priors & Distributions |
| 03 | Bayesian VAR for Marketers | Model long-term cross-channel effects with Vector AutoRegression | VAR Modeling |
| 04 | Portfolio Budget Optimization | Optimize budgets across multiple brands with risk adjustment | Budget Optimization |
Enhanced Modeling
| # | Notebook | What You’ll Learn | Docs Link |
|---|---|---|---|
| 05 | Delayed Adstock | Model advertising effects that peak days or weeks after exposure | Adstock Effects |
| 06 | GP-Smoothed Events | Handle holidays and events with Gaussian Process smoothing | Seasonality |
| 07 | Time-Varying Coefficients | Allow media effectiveness to change over time with HSGP | Bayesian Modeling |
| 08 | Tanh Saturation Deep Dive | Understand the two-parameter tanh saturation function | Saturation Curves |
Production Workflows
| # | Notebook | What You’ll Learn | Docs Link |
|---|---|---|---|
| 09 | Model Diagnostics Checklist | Comprehensive post-fit model validation | Measurement |
| 10 | Lift Test Calibration | Integrate incrementality evidence as likelihood observations | Incrementality |
| 11 | Scenario Planning | Run what-if budget scenarios with posterior uncertainty | Scenario Planning |
| 12 | Halo & Trademark Effects | Model cross-brand advertising spillover | Halo Effects |
Integration & Advanced
| # | Notebook | What You’ll Learn | Docs Link |
|---|---|---|---|
| 13 | MMM-to-VAR Pipeline | Combine short-term MMM with long-term VAR insights | VAR Modeling |
| 14 | Semantic Channel Detection | Auto-classify media columns by channel type | Supported Channels |
Requirements
pip install pymc-marketing matplotlib pandas numpy scipy scikit-learn
Sample Data
The data/ directory contains synthetic marketing datasets used across notebooks:
sample_mmm_weekly.csv— 104 weeks of media spend + revenue for a single brandsample_multi_brand.csv— Multi-brand dataset for portfolio analysis
About
These notebooks are companion materials for Simba MMM. The open-source PyMC-Marketing library provides the foundation; these notebooks show you how to use it effectively.