# marketing-mix-modeling-pipeline

An end-to-end Python Marketing Mix Modeling pipeline covering geometric adstock, Hill saturation curves, OLS regression, and budget optimization.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 130 installs · ★ 12 repo stars
- Author: reason-machines
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/reason-machines/marketing-skills/tree/HEAD/skills/marketing-mix-modeling-pipeline/SKILL.md
- Updated: 2026-10-09
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/marketing-mix-modeling-pipeline

## What it does

This skill sets up a complete Marketing Mix Modeling (MMM) workflow in Python using aggregated historical spend. It computes carryover effects via geometric adstock and accounts for diminishing returns using Hill saturation curves. A statsmodels OLS regression then separates baseline performance from incremental revenue generated by individual media channels.

The project includes Python source modules in `src/`, exploratory notebooks, and sample budget allocation routines. The mathematical sequence is strict: saturation formulas must run on top of adstocked series, never before them.

Running the code requires Python 3 alongside pandas, numpy, statsmodels, scipy, matplotlib, and seaborn. Since the pipeline processes aggregated weekly numbers, it operates without any user-level tracking.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/marketing-skills --skill marketing-mix-modeling-pipeline -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/marketing-mix-modeling-pipeline/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/marketing-mix-modeling-pipeline/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/marketing-skills --skill marketing-mix-modeling-pipeline -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/marketing-mix-modeling-pipeline/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/marketing-skills --skill marketing-mix-modeling-pipeline -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/marketing-mix-modeling-pipeline/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install reason-machines/marketing-skills skills/marketing-mix-modeling-pipeline
```

2. **Manually: put the files in place**
- File: `.github/skills/marketing-mix-modeling-pipeline/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/marketing-skills --skill marketing-mix-modeling-pipeline -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/reason-machines/marketing-skills --path skills/marketing-mix-modeling-pipeline
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/marketing-mix-modeling-pipeline/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add reason-machines/marketing-skills --skill marketing-mix-modeling-pipeline -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/reason-machines/marketing-skills/tree/HEAD/skills/marketing-mix-modeling-pipeline/SKILL.md

## When to use it
- Model carryover advertising effects using geometric adstock decay
- Capture diminishing returns with Hill saturation functions
- Estimate channel revenue contribution through OLS regression
- Reallocate marketing spend to maximize predicted revenue

## Example prompts
- Build a marketing mix modeling pipeline for weekly media spend
- Apply geometric adstock and Hill saturation curves to my spend data
- Fit an OLS regression on transformed channel features and extract coefficients

## Similar
- [statsmodels](https://affpapa.org/en/nevibecode/skills/k-dense-ai-statsmodels.md) — skill · 2400 installs
- [attribution](https://affpapa.org/en/nevibecode/skills/attribution.md) — skill · 49700 installs
- [Time Series Analysis](https://affpapa.org/en/nevibecode/skills/time-series-analysis.md) — skill · 617 installs
- [cointegration-analysis](https://affpapa.org/en/nevibecode/skills/cointegration-analysis.md) — skill · 511 installs
- [mix-engineer](https://affpapa.org/en/nevibecode/skills/mix-engineer.md) — skill · 402 installs
- [pair-trade-screener](https://affpapa.org/en/nevibecode/skills/pair-trade-screener.md) — skill · 3800 installs

From the same set: [reason-machines/marketing-skills](https://affpapa.org/en/nevibecode/by/reason-machines/marketing-skills.md) — 79 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
