On this page
concept

PyMC-Marketing

Created 2026-08-15 30 connections

PyMC-Marketing

PyMC-Marketing is an open-source Python library for Bayesian marketing analytics, built and maintained by PyMC Labs. It provides production-ready implementations of Media Mix Modeling (MMM), Customer Lifetime Value (CLV), Customer Choice, Bass Diffusion, and a Predicted Incrementality by Experimentation (PIE) module. It reached its first stable major version — v1.0.0 — on 2026-08-07, having been in active development since April 2023. (Source: PyPI — pypi.org/project/pymc-marketing — as-of 2026-08-07)


What it is

PyMC-Marketing applies Bayesian probabilistic inference — rather than frequentist optimisation — to the problem of attributing sales or conversions to marketing channels. Whereas Meta Robyn uses ridge regression with Nevergrad-driven hyperparameter search and Google Meridian uses variational inference backed by TensorFlow Probability, PyMC-Marketing uses full Markov Chain Monte Carlo (MCMC) sampling via the No-U-Turn Sampler (NUTS), producing posterior probability distributions over all model parameters rather than single point estimates.

This means PyMC-Marketing answers not only "how much did this channel contribute?" but "how confident are we, and what is the plausible range?" — a capability that Bayesian credible intervals formalise and that neither Robyn nor Meridian provide in the same form. (Source: pymc-marketing.io comparison table — as-of 2025-10-17)


Technical architecture

PropertyDetail
LanguagePython (≥ 3.12)
Core dependencyPyMC ≥ 6.0, ArviZ ≥ 1.2
Inference engineNUTS (MCMC); swappable backends
LicenceApache 2.0
First releasev0.0.2 — April 2023
Stable releasev1.0.0 — 2026-08-07

(Source: PyPI — pypi.org/project/pymc-marketing — as-of 2026-08-07)

Sampler backends (as-of 2026-08-07)

The default inference engine is PyMC's own NUTS implementation. Teams can swap in alternative samplers to trade speed and scalability:

  • Nutpie — a Rust reimplementation of NUTS; recommended for large datasets; PyMC Labs calls it the "enterprise-scale" backend
  • NumPyro — JAX-based; high ESS/s on small-to-medium datasets
  • BlackJAX — also JAX-based; similar profile to NumPyro
  • GPU sampling is supported through these backends

(Sources: pymc-labs.com benchmark 2025-09-08; Nuso blog 2026-03-10)

Key MMM capabilities (as-of 2026-08-07)

  • Adstock transformations: geometric adstock, Weibull adstock, custom adstock
  • Saturation curves: Hill saturation, logistic saturation, custom saturation
  • Budget optimizer: allocate_budget_to_maximize_response; MultiDimensionalBudgetOptimizerWrapper (new API replacing the original)
  • Lift-test calibration: add_lift_test_measurements — works via custom likelihood functions on the saturation curve, not ROAS priors; each additional lift test at a different spend level continuously improves saturation curve estimates (Source: pymc-labs.com blog 2026-04-16)
  • Time-varying parameters: Hilbert Space Gaussian Processes (HSGP) for time-varying intercepts and media coefficients
  • Hierarchical geographic modeling
  • Out-of-sample forecasting with credible intervals — not available in Robyn or Meridian (Source: pymc-marketing.io comparison — as-of 2025-10-17)
  • Funnel-aware modeling: treats lower-funnel channels as both a dependent variable and a predictor, using PyMC's do operator for causal identification
  • MLflow integration for experiment tracking
  • Zarr save/load (v1.0.0, 2026-08-07) — models can be saved and loaded without fit data
  • Fivetran-based database connectors for standardised data ingestion
  • Causal identification via DAGs
  • PIE (Predicted Incrementality by Experimentation) — alpha module in v1.0.0 for experiment-based incrementality estimation
  • MMMCVPlotSuite — cross-validation plots (v0.19.3, April 2026)
  • DiagnosticsPlots, DecompositionPlots, SensitivityPlots — diagnostic namespaces (0.19.x series)

Benchmarks vs Google Meridian

The PyMC Labs benchmark was published September 2025 and tested PyMC-Marketing 0.15.1 (Nutpie) against Meridian 1.1.6. Both products have had significant updates since: PyMC-Marketing reached 1.0.0 in August 2026; Meridian added GeoX and Studio in May 2026 and integrated with Google Analytics 360. No independent replication of this benchmark has been confirmed as of 2026-08-15.

PyMC Labs published a benchmark in September 2025 testing PyMC-Marketing 0.15.1 (Nutpie sampler) against Meridian 1.1.6 across four synthetic dataset scales (startup, scale-up, mature, enterprise) on an n1-standard-32 GCE machine with 4 chains and 2,000 draws each. The benchmark code was published at github.com/pymc-labs/mmm-param-recovery. (Source: pymc-labs.com blog 2025-09-08 — as-of 2025-09-08)

Key benchmark results (as-of 2025-09-08):

MetricPyMC-Marketing (Nutpie)Meridian
ESS/s (startup scale)22.975.66
ESS/s (enterprise scale)0.19Failed to converge
Contribution SRMSE (startup)0.410.70
In-sample R² (startup)0.870.73
MAPE (startup)7.2%10.4%
Durbin-Watson (startup)~1.8–2.01.13
Durbin-Watson (mature scale)~1.8–2.00.40
Model file size (startup)53 MB2 MB
Model file size (enterprise)19 GB50 MB
RAM during fitting (smallest)Laptop-feasible≥ 5 GB

The large disk footprint of PyMC-Marketing is because the model object includes the data for reproducibility; the library's documentation notes that future versions aim to make storage more compact. During fitting (in-memory RAM), however, PyMC-Marketing uses substantially less than Meridian. (Source: pymc-labs.com blog 2025-09-08)

A second benchmark iteration (October 2025, testing v0.17.0 vs Meridian v1.2.1) found that Meridian's Automated Knot Selection improved its in-sample R² and MAPE — at small datasets Meridian reached R² 0.930 vs PyMC-Marketing's 0.871 — but introduced stronger residual autocorrelation (lower Durbin-Watson) and increased leakage of media signal into the baseline. PyMC-Marketing continued to outperform Meridian on contribution recovery (lower SRMSE, lower CRPS) across small, growing, and medium dataset sizes. (Source: PyMC Labs YouTube blog proxy 2025-10-09)

Meridian in-sample fit vs attribution quality. Meridian v1.2.1 shows higher R² and lower MAPE than PyMC-Marketing in goodness-of-fit metrics, yet lower contribution-recovery accuracy. The benchmark authors treat these as distinct (predictive accuracy ≠ causal accuracy), positioning a more flexible spline baseline as the cause — it absorbs variation that should be attributed to media channels. No independent replication has been published. (Source: PyMC Labs blog 2025-10-09 vs pymc-labs benchmark 2025-09-08 — conflict of interest: PyMC Labs authored both)


Comparison with Meta Robyn and Google Meridian

DimensionPyMC-MarketingMeta RobynGoogle Meridian
LanguagePythonRPython
MethodBayesian MCMCRidge regression + NevergradVariational inference (TFP)
Credible intervals✅ Yes❌ NoPartial
Out-of-sample forecasting✅ Yes❌ No❌ No
Lift-test calibration✅ Via likelihood❌ No✅ Via priors
GPU support✅ Via backends❌ No✅ TFP
Fitting speed (typical)20 min – hours5–15 minVaries
Min RAM (small dataset)Laptop-feasibleLaptop≥ 5 GB
MLflow integration✅ Yes❌ No❌ No
DB connectors (Fivetran)✅ Yes❌ NoLimited (Google ecosystem)
Geo modelingHierarchicalLimitedStrong (native GeoX as-of May 2026)
Organic search confound❌ Manual❌ Manual✅ Native (Google data ecosystem)

(Sources: pymc-marketing.io comparison — as-of 2025-10-17; Nuso blog 2026-03-10; adbeacon.com 2026-08-11)

Meta Robyn uses ridge regression (frequentist, not Bayesian), explores thousands of adstock/saturation configurations via Nevergrad gradient-free optimisation to produce a Pareto frontier of models, and does not produce posterior credible intervals. It is significantly faster (5–15 minutes per run on a laptop). Multiple agency and measurement vendor sources told AdExchanger in July 2026 that Meta has stopped actively pushing Robyn and its internal engineering team has been effectively dismantled; Meta has not formally announced discontinuation and the code remains open-source. (Source: adbeacon.com 2026-08-11; Nuso blog 2026-03-10)

Google Meridian genuinely outperforms Robyn and PyMC-Marketing when hierarchical geo-level data is available and the brand is heavy on Google Search/YouTube spend, as Meridian's default priors are calibrated on Google's own advertising research. Meridian added GeoX (geo-level incrementality testing), Meridian Studio (large-scale model management on Google Cloud), and a Scenario Planner in February–May 2026, and announced integration with Google Analytics 360 at Google Marketing Live (May 2026). Google's sales teams reportedly have KPIs tied to Meridian adoption. (Sources: adbeacon.com 2026-08-11 — as-of 2026-08-11; Nuso blog 2026-03-10)


Adoption and community

  • PyPI downloads: ~116,600 per month (as-of April 2026); PyMC-Marketing claims this is the highest among Robyn, Meridian, and PyMC-Marketing by PyPI download volume (Source: pymc-marketing.io comparison — as-of 2025-10-17)

Download volume figure of ~116,600/month is from April 2026 comparison page.

  • GitHub: ~1,200 stars, 390 forks (as-of mid-2026); 34 PRs merged in a 30-day window (April 2026); 372 open issues, 45 open PRs (as-of 2026-08-15) — active maintenance (Source: GitHub pymc-labs/pymc-marketing — as-of 2026-08-15)
  • Release cadence: monthly to bi-monthly throughout 2025–2026; first public release April 2023 (v0.0.2), stable release August 2026 (v1.0.0) (Source: PyPI history — as-of 2026-08-07)
  • Community channels: GitHub Discussions, PyMC Discourse (discourse.pymc.io), Bayesian Discord, MMM Hub Slack (Source: PyPI — as-of 2026-08-07)
  • Commercial adoption signals: Calybra (startup) posted a job specifically requiring PyMC-Marketing expertise in June 2026; HelloFresh is cited in PyMC Labs case studies (Source: PyMC Discourse 2026-06; pymc-labs.com — date unconfirmed)

Ecommerce and retail applicability

The Nuso blog (2026-03-10) identifies Shopify DTC brands spending £1m+ annually across paid channels as a target segment for PyMC-Marketing, recommending it for brands that value credible intervals on channel contributions over fast iteration speed. (Source: Nuso blog 2026-03-10)

The PyMC Labs benchmark uses HelloFresh and Peloton as archetypal "mature company" use cases (multi-region digital brands) and Nike, P&G, and Colgate as "enterprise" use cases — though no primary source confirms these companies are actual users of the library. (Source: pymc-labs.com blog 2025-09-08)

Case study — Nürnberger Versicherung (2026): PyMC Labs built a funnel-aware Bayesian MMM on PyMC-Marketing treating lower-funnel spend as both a dependent variable and a predictor of lead generation, using a censored likelihood to handle budget-cap days. The result was a 27%+ reduction in cost per lead. The BudgetOptimizer was extended with PyMC's do operator to jointly optimise upper-funnel channel spend and lower-funnel budget caps simultaneously. Hilbert Space Gaussian Processes (HSGP) captured seasonality and organic growth not caused by marketing. (Source: PyMC Labs YouTube blog proxy 2026-01-27 — as-of 2026)

Case study — Qonto (fintech): Qonto ran a public MMM case study (6-part Medium series, May–December 2024) using raw PyMC rather than pymc-marketing, having moved away from the library after finding the wrapper abstraction insufficient for their modelling needs. This is cited in the PyMC Discourse community as evidence of the library's steep learning curve. (Source: PyMC Discourse 2024-05; Qonto Medium 2024)


Known limitations

  • Sampling speed: a typical dataset (4 channels, ~100 weeks) takes 20 minutes to several hours on a laptop — significantly slower than Robyn (5–15 minutes) or Meridian (Source: Nuso blog 2026-03-10 — as-of 2026-03-10)
  • Steep learning curve: requires familiarity with Python, Bayesian inference, and MCMC diagnostics (R-hat, ESS, trace plots); practitioners who cannot interpret divergences and trace plots risk accepting unconverged models (Source: Nuso blog 2026-03-10; PyMC Discourse 2024-05)
  • Divergences common: users routinely report 2–20 divergences even at target_accept=0.99 (Source: GitHub Discussions 2024-06)
  • Wrapper constraint: the model abstraction prevents reparameterisation — a standard MCMC fix for divergences — because the underlying PyMC model is not directly accessible to the user (Source: GitHub Discussions 2024-06)
  • Enterprise scale convergence: at enterprise scale (50 geos, 30 channels, 4 years), Nutpie showed 11% of parameters with R-hat > 1.1 (Source: pymc-labs.com benchmark 2025-09-08 — as-of 2025-09-08)
  • Large on-disk model size: 19 GB at enterprise scale vs Meridian's 50 MB (because PyMC-Marketing stores data inside the model object) (Source: pymc-labs.com benchmark 2025-09-08)
  • Budget optimizer instability: users have reported the optimizer hanging for hours even on 16 vCPUs / 128 GB RAM; root cause traced to nondeterministic slowdown in pytensor's batched convolution; fix shipped in a later version (Source: PyMC Discourse 2024-08 to 2025-04)
  • API breakage on migration: the original MMM class is being deprecated in favour of a multidimensional API; old fitted models are incompatible with the new MultiDimensionalBudgetOptimizerWrapper (Source: PyMC Discourse 2025-10 — as-of 2025-10)

Regular MMM ROAS vs multidimensional API ROAS. A practitioner reported (December 2025) that ROAS estimates from the regular MMM class are "significantly different and more realistic" for high-spending channels compared to the new multidimensional API. The PyMC Labs team confirmed the MMM class will be deprecated but had not explained the ROAS discrepancy publicly as of December 2025. (Source: PyMC Discourse 2025-12)


What practitioners report

  • "After hearing the Qonto talk, pymc-marketing stuff might from some perspective look like a sort of bait which seems to make life easy, but after starting with it I find myself with an incomplete and unsatisfying model." — data scientist in PyMC Discourse, May 2024 (Source: discourse.pymc.io 2024-05)
  • Core dev response: "There is no free lunch! Throwing a generic ML algorithm to a random problem and hoping for the best is easy. Making good decisions from a good model is a different story." — juanitorduz (core contributor), PyMC Discourse, May 2024 (Source: discourse.pymc.io 2024-05)
  • "The model itself is only about 20% of the work. The other 80% is consolidating and transforming data. ETL pipelines are the real bottleneck." — János Moldvay, VP of Measurement at Funnel.io, September 2025 (Source: funnel.io/blog/open-source-marketing-mix-modeling 2025-09 — applies to all open-source MMMs)
  • Organisations are assigning PyMC-Marketing as the default MMM stack to new practitioners: "I need to develop a MMM model at my internship right now. They have suggested to use PyMC which uses bayesian approach." — r/learnmachinelearning, February 2025 (Source: Reddit metadata 2025-02)

Key terms

TermMeaning
NUTSNo-U-Turn Sampler — the MCMC algorithm at PyMC-Marketing's core
ESS/sEffective Samples per Second — a benchmark for sampling efficiency
HSGPHilbert Space Gaussian Process — efficient approximation for time-varying parameters
R-hatConvergence diagnostic: values near 1.0 indicate convergence; >1.1 is problematic
AdstockTransformation modelling the carry-over (decay) of advertising effects over time → Adstock
Saturation curveFunction modelling diminishing returns to advertising spend
SRMSEScaled Root Mean Square Error — used to benchmark channel contribution recovery
PIEPredicted Incrementality by Experimentation — alpha module for experiment-based lift

Benchmarks (as-of 2025-09-08)

Benchmark tested PyMC-Marketing 0.15.1 vs Meridian 1.1.6. Both have had major updates. PyMC-Marketing reached 1.0.0 in August 2026; no updated benchmark has been published as of this harvest.

MetricStartup scaleEnterprise scale
ESS/s (Nutpie)22.970.19
ESS/s (Meridian)5.66Failed
SRMSE (PyMC-Mktg)0.41
SRMSE (Meridian)0.70
R² (PyMC-Mktg)0.870.99
R² (Meridian)0.73NA (non-convergent)

(Source: pymc-labs.com/blog-posts/pymc-marketing-vs-google-meridian — 2025-09-08)


Next frontier

  • Adstock — transformation at the core of all MMM models; no dedicated page; 16+ refs across vault
  • Decision Lab — PyMC Labs' agentic Bayesian data science framework; announced May 2026; no page
  • Meta Robyn — Robyn winding down per AdExchanger Jul 2026; no dedicated entity page
  • Qualified Future Conversions (QFC) — Gemini-powered Google Ads metric; circularity risk with MMM; no page
  • Marketing Attribution — parent concept; no dedicated concept page
Research agent · 2026-08-15