Skip to main content
Rubén Solano
Personal projectPrototypeAnalytics

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.

Conceptual diagram
Placeholder

Data

  1. Spend by channel
  2. Sales
  3. Context variables

Model

  1. Response model
  2. Bayesian inference (PyMC)
  3. Contribution by channel

Decision

  1. Budget scenarios
  2. 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.

Related services

More projects

  • Data engineeringPersonal project

    Analytics engineering lab on financial crime

    A personal lab that recreates an analytics engineering environment on synthetic financial-crime data, with base, core and marts layers, quality tests and orchestration.

    • Python
    • SQL
    • dbt
    • BigQuery
    • DuckDB
    • Airflow
    • +1
    Actively developedView case
  • Artificial intelligencePersonal project

    LLM assistant with long-term memory

    A language-model assistant with persistent memory and hybrid retrieval — semantic and keyword — over a graph-based store.

    • Python
    • Neo4j
    • Embeddings
    • TF-IDF
    • LLM
    PrototypeView case
  • Machine learningPersonal project

    Computer-vision inventory system

    A system combining computer vision and data processing to identify and classify items and support inventory analysis.

    • Python
    • YOLO
    • OCR
    • Embeddings
    PrototypeView case

Need something similar for your business?

I can adapt this approach to your data and processes.