MMM

Nexus fits Bayesian marketing mix models with PyMC-Marketing, in two stages that follow the funnel, and reports the diagnostics alongside the results. A model that did not converge says so. It does not quietly present its numbers as findings.

What the model is doing

A marketing mix model asks a simple question with a hard answer: given what you spent across channels over time, and what revenue followed, how much of that revenue is attributable to each channel?

It is hard because spend across channels moves together. When budgets rise for Black Friday, they rise everywhere at once, so the data contains little evidence about which channel caused what. It is hard because advertising does not pay back the day you spend — a view today can convert next week. And it is hard because the relationship is not linear: the tenth thousand pounds in a channel does less than the first.

A Bayesian model handles these honestly. Rather than returning one number per channel, it returns a distribution — a range of values consistent with the data — so you can see how confident the model is, not only what it concluded. Where the data cannot separate two channels, the model says so with wide intervals, instead of splitting the difference and presenting a false precision.

Why one model is the wrong shape

Run a single model on revenue and the upper funnel disappears.

Brand advertising, video, connected TV and display do not produce a click that precedes a purchase. What they produce is demand — someone who had not been thinking about you starts thinking about you, and arrives weeks later through search or direct. A single model regressing revenue on all channels at once sees the search spend sitting next to the conversion and credits search. The channel that created the demand gets the residual, which is usually close to nothing.

This is not a subtle bias. It is the reason upper-funnel budgets get cut by measurement every year and then quietly restored when demand falls off a cliff two quarters later. The model was never wrong about what it measured; it was asked a question whose structure guaranteed the answer.

Two stages, following the funnel

Nexus splits the problem in the place the funnel already splits it.

Stage one fits demand creation. Upper-funnel channels are modelled against a demand signal rather than against revenue — the intermediate outcome they are actually responsible for. Carryover is set long, because brand effects persist, and an annual seasonality term absorbs the organic cycle that would otherwise be credited to media.

Stage two fits revenue. Lower-funnel, direct-response channels are modelled against revenue, with a shorter carryover window because direct response pays back quickly. Crucially, the demand that stage one attributed to upper-funnel channels enters stage two as a regressor. Stage two therefore has to explain revenue while accounting for the demand that already existed — so search and retargeting are credited for converting demand, not for creating it, and the channels that created it retain their contribution through the link between the stages.

That link is the whole design. It is what lets the model distinguish a channel that generates new demand from one that harvests demand that was already there, which is the distinction every media team argues about and almost no single-stage model can make.

Channels are classified by how they behave — whether they produce clicks at all, and whether they harvest existing intent — rather than by a label someone typed.

Constrained priors, and why

Left unconstrained, a marketing mix model will reach conclusions that are arithmetically consistent and physically impossible. Nexus bounds the parameters where the physics are known:

Saturation curves are bounded. A free Hill slope will happily fit a near-step function: almost no return up to some threshold, then an explosion. No media channel behaves that way, and a budget optimiser handed that curve will recommend cutting a profitable channel to zero because the curve says the first pound does nothing. The slope is constrained to a range consistent with how media actually saturates.

Channel contributions are anchored to spend share. Without an anchor, a model can attribute more revenue to media than the business earned, or hand one platform the overwhelming majority of credit on thin evidence. Priors anchor each channel near its share of spend, wide enough that the data can move them substantially, tight enough that they cannot run away.

The baseline is anchored. Some revenue would have happened anyway. Stage two's intercept is anchored near a low-percentile week — a floor the business reaches without media — so the model cannot explain organic revenue as advertising, which is the mechanism behind most implausibly high reported ROI.

These are priors, not constraints on the answer. Where the data genuinely contradicts the prior, the posterior moves, and Nexus reports how far each channel's estimate travelled from its prior — a channel whose posterior barely moved is one the data had little to say about, and that is worth knowing before acting on its number.

Diagnostics ship with the result

Every run reports:

  • R-hat — whether the sampler's independent chains agree. Values near 1.00 mean they converged on the same answer.

  • Effective sample size — how many genuinely independent draws were obtained. A high nominal count with a low effective one means the chains wandered rather than explored.

  • R² — how much of the observed variance the model accounts for.

  • A convergence flag — evaluated against explicit thresholds and surfaced as a single pass or fail.

Diagnostics are reported at their worst across both stages. The R-hat you see is the higher of the two; the effective sample size is the lower. A clean second stage does not excuse a first stage that failed, and reporting only the final fit would conceal exactly the problem diagnostics exist to catch.

This matters because the failure mode of marketing mix modelling is not an error message. A model that has not converged still returns plausible-looking contributions, and without diagnostics there is no way to tell that result from a good one until the revenue does not follow.

Reproducibility

Sampling uses a fixed random seed. The same inputs produce the same posterior, so a result reviewed last month reproduces this month, and a change in the answer means a change in the data or the specification rather than sampling noise.

This is a lower bar than it sounds and much of the category does not clear it. If a model returns a different attribution each run, the attribution was never the finding.

What this does not tell you

A marketing mix model is observational. It describes patterns in data you already have; it does not run an experiment.

  • It cannot establish causation on its own. If a channel's spend has always risen alongside a seasonal peak, the model may credit the channel.

  • It cannot evaluate what you have never tried. A channel that has only run between 10% and 15% of budget carries no information about 40%.

  • It is sensitive to specification. Different carryover and saturation assumptions produce different contributions from identical data. Nexus's assumptions are stated above rather than hidden, which is the most anyone can honestly offer.

The appropriate use is as a prior to be tested, not a verdict. Where the model says a channel is undervalued, the next step is an experiment that checks it — see Incrementality and event lift.

Why we show the uncomfortable numbers

The commercial incentive runs the other way. A vendor reporting only contributions looks more confident than one reporting contributions with a convergence warning attached, and confidence sells.

It also produces decisions that quietly fail. A team that reallocates six figures on an unconverged model will not find out for a quarter, and the lesson they draw is that marketing mix modelling does not work — rather than that this fit did not. Showing the diagnostics is how the method keeps its credibility.

Previous
Previous

Incrementality and event lift