skillfed

pymc-marketing

Marketing Statistical Models in PyMC

pymc-marketing v1.0.0 184.7K downloads/30d#10,026 on PyPI1,224
Permissive license Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) Active released

What it is and what it does

PyMC-Marketing is a Bayesian statistical modeling library for marketing analytics built on top of PyMC, ArviZ, and related tools. It provides domain-specific implementations of Marketing Mix Models, Customer Lifetime Value estimation, discrete choice models, and experimentation frameworks that allow marketers and analysts to quantify the causal impact of marketing channels and customer behaviors.

The package is designed for practitioners who want to move beyond frequentist attribution methods and leverage Bayesian inference to incorporate prior knowledge, handle uncertainty explicitly, and make probabilistic predictions. It includes features like adstock transformations to model carryover effects, saturation functions to capture diminishing returns, time-varying intercepts and media efficiency, and causal identification tools via directed acyclic graphs. Models can be customized with domain-specific priors and likelihoods, and inference can be run on CPUs or GPUs via PyMC's backend options.

Use it for:

  • Quantify the incremental impact of each marketing channel on sales or conversions using Bayesian MMM with carryover and saturation effects.
  • Estimate customer lifetime value distributions to inform acquisition budgets and retention strategies.
  • Analyze discrete choice behavior (e.g., MaxDiff surveys, product preferences) using Bayesian hierarchical choice models.
  • Test incrementality of marketing experiments with PIE (Predicted Incrementality by Experimentation) framework.
  • Model product adoption and diffusion curves using Bass Diffusion models for new product forecasting.
  • Incorporate causal domain knowledge via DAGs to identify confounders and improve model validity.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PyMC-Marketing provides Bayesian statistical models for marketing analytics, including Marketing Mix Modeling (MMM), Customer Lifetime Value (CLV), Customer Choice, Bass Diffusion, and Predicted Incrementality by Experimentation (PIE).

Yes, if you need Bayesian marketing analytics and are comfortable with the PyMC ecosystem. The package is actively maintained, has no known vulnerabilities, uses a permissive license, and offers specialized tools for MMM and CLV that are difficult to assemble from scratch. Requires Python >= 3.12 and a substantial dependency stack; best suited for teams with statistical modeling experience or access to consulting support.

Install

pymc-marketing on PyPI

pip

pip install pymc-marketing

uv

uv add pymc-marketing

poetry

poetry add pymc-marketing

Installing pymc-marketing

Before you install

Low install friction with a pure-Python wheel. Active maintenance with a release 7 days ago and ongoing commits. Requires Python >= 3.12 and depends on a large Bayesian stack (pymc, arviz, pytensor, numpy, pandas, scikit-learn, and others).

License in practice

Apache License 2.0 is permissive; you may use, modify, and distribute this package freely in commercial and private projects, provided you include the license and attribute changes.

Quickstart

pip install pymc-marketing

import pymc_marketing
from pymc_marketing.mmm import MMM

# Create and fit a Marketing Mix Model
model = MMM(data=your_data, adstock='geometric', saturation='logistic')
model.fit()

Requires Python >= 3.12. Fitting models requires sufficient memory for Bayesian sampling and may be computationally intensive depending on data size and model complexity.

Verify before relying

  • Whether optional extras (dag, pie) are commonly needed or if base installation covers most use cases
  • Typical model fitting time and computational requirements for datasets of different sizes
  • How well the package integrates with existing marketing analytics pipelines outside the PyMC ecosystem

Package facts

License Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.12)
Install friction low — pure-Python wheel
Runtime dependencies 19 — arviz-plots, arviz, matplotlib, narwhals, numpy, pandas, patsy, preliz, pydantic, pymc-extras, pymc, pyprojroot, pytensor, pyyaml, scikit-learn, seaborn, tqdm, xarray-einstats, xarray
Maintenance actively maintained — 7 days since the last release
Last repo commit
First released
Downloads 184,703/month — #10,026 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pymc_marketing-1.0.0-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: MathematicsTyping :: Typed

Tags

bayesian marketing mix modelingcustomer lifetime value analysismarketing attribution modelingbayesian customer choice modelsincrementality testing frameworkmedia mix optimizationmarketing analytics bayesian
bayesian-inferencemarketing-analyticscausal-modeling

More Scientific/Engineering packages