The Mathematics and Engineering of Marketing Mix Modeling
A self-contained path from calculus, linear algebra, and calculus-based statistics to advanced MMM practice.
Preface
This book develops Marketing Mix Modeling (MMM) from first principles. It begins from a standard undergraduate quantitative background and builds, in order, the linear algebra, probability, Bayesian inference, sampling, and optimization that a modern MMM depends on; it then constructs the MMM itself, its calibration against experiments, and the software engineering required to run it. Bayesian modeling, MCMC, causal inference, and constrained optimization are each built up rather than assumed.
The emphasis throughout is on understanding and intuition. The book derives the underlying mathematics so that the reader can see what each method assumes, why it works, and the conditions under which it fails. MMM serves as the application that motivates and connects the material; the mathematics is developed on its own terms.
Where many technical books survey a field — a method per chapter, read in any order — this one is a single ascent. Each part assumes the ones before it and exists to support the ones after, and one application, marketing mix modeling, runs through all of them. The aim is not to catalogue methods but to follow a single model the whole way down to its foundations and back up to a system that can be run: from the linear algebra and probability beneath it, through inference, sampling, and optimization, to causal calibration and the software engineering that puts it into production.
Who this book is for
The book assumes familiarity with:
- Calculus — derivatives, integrals, sequences and series.
- Linear algebra — vectors, matrices, and the solution of linear systems.
- Calculus-based statistics — random variables, expectation, common distributions, and the notion of a likelihood.
- Mathematical maturity — some experience reading and writing proofs, as acquired in discrete mathematics, an introduction-to-proofs course, or real analysis.
The mathematics begins at the undergraduate level and rises to advanced master’s / early-PhD rigor as the book proceeds. A result is proved where the proof is illuminating and cited where it is merely mechanical.
By the end, the reader should be able to derive and build a full Bayesian MMM — from the data-generating process, through prior specification and MCMC inference, to budget optimization grounded in experiment — and to understand the assumptions and limitations of each component.
The formal prerequisites above are the floor, not the ideal starting point. Readers who already work comfortably with regression modeling, constrained optimization, and Bayesian statistics will benefit most quickly: the book converges on precisely the intersection of those three, and prior fluency in any of them turns a derivation to be learned into one to be recognized. None is required — each is an accelerant.
It is also worth saying what this book is not. It is not a survey of marketing-analytics methods, nor a manual for any particular software framework, nor a deep reference on any single discipline it draws upon — readers who want breadth across methods, or the last word on Bayesian computation or convex optimization, are better served by the dedicated texts this book builds on and points to. What it offers instead is the through-line those sources leave out: one model, derived from first principles and carried all the way to a system you can operate. Each borrowed field is developed as far as that model requires, and no further.
How to use this book
Each chapter follows the same structure: intuition, then theory and proofs, then worked examples, then a runnable code tie-in, then exercises, then a summary. The exercises come in four tiers:
- C — Conceptual / reading comprehension.
- B — By hand (compute or derive manually).
- P — Prove it (short proofs).
- A — Applied / code.
Worked solutions are kept as a separate answer key rather than printed inline, so each exercise is reached only after a genuine attempt. Instructors and readers who would like the full answer key can request it by reaching out to 548 Marjan.
Each chapter closes with a summary: the concepts to be able to state and the identities to be able to reproduce before moving on.
Reproducibility
The code is original and self-contained — minimal NumPy, SciPy, and Matplotlib snippets that illustrate the same patterns a production MMM uses, with no proprietary source, priors, or client data. Pinned dependencies live in requirements.txt. Heavier cells are cached with Quarto’s freeze, so the book renders quickly and reproducibly.
Canonical sources
Each topic is anchored to standard references — Strang and Axler for linear algebra; Casella & Berger for statistics; Gelman et al. (BDA3), Gelman & Hill, and McElreath for Bayesian modeling; Robert & Casella, Neal, and Betancourt for MCMC/HMC; Boyd & Vandenberghe, Bertsimas & Tsitsiklis, and Nocedal & Wright for optimization; Imbens & Rubin and Angrist & Pischke for causal inference and quasi-experimental design; and the published MMM literature (Jin et al.) for the application. Full citations are in the bibliography.