Skip to content

Latest commit

 

History

History
44 lines (28 loc) · 1.63 KB

File metadata and controls

44 lines (28 loc) · 1.63 KB

Bayesian Methods for Media Mix Modeling (MMM)

This repository implements the MMM approach from the paper "Bayesian Methods for Media Mix Modeling with Carryover and Shape Effects" by Yuxue Jin, Yueqing Wang, Yunting Sun, David Chan, and Jim Koehler (Google), published April 14, 2017. This code is covered by the MIT License; see LICENSE.

While this implementation is less feature-rich than tools such as LightweightMMM or Meridian, it aims to expose the core mathematics and mechanics of MMM with fewer dependencies and simpler setup.

Installation

Ensure you have Python 3.10+ installed. Then install dependencies:

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Usage

  • See src/main.py for example invocations and data expectations.
  • Global configuration values are marked with TODO statements in src/config.py and src/mmm.py. Tune these to your specific use case. The default values are recommended only for testing.
  • For Bayesian sampling backends, consider tools like PyStan documentation, as referenced in the paper.

Run the main script:

python src/main.py

Tests

Install dev-only dependencies and run the test suite with pytest:

pip install -r requirements-dev.txt
python -m pytest -q

Reference

License

This project is licensed under the MIT License. See LICENSE for details.