Course

Chapter 5: The Engine Room: MCMC, Adstock, and the Hill Effect

Table of contents
To Top

Because the posterior distributions in a complex model like Meridian are analytically intractable, they must be approximated. Meridian uses sophisticated Markov Chain Monte Carlo (MCMC) sampling, specifically Hamiltonian Monte Carlo (HMC) and its adaptive variant, the No-U-Turn Sampler (NUTS). For a data scientist accustomed to the computational demands of MCMC, the use of HMC is a sign of modern best practices. It’s far more efficient at exploring high-dimensional, correlated parameter spaces than older methods like Gibbs or random-walk Metropolis, leading to faster convergence and more reliable posterior samples. The output is a set of “draws” (typically thousands) for each parameter, which collectively form its posterior distribution.

The core of the model’s feature engineering lies in its two-stage transformation of media spend:

  • Ad Stock: This captures the lagged or carryover effect of advertising. It transforms a time series of media spend into a time series of “ad presence” in the consumer’s mind. The most common form is a geometric decay, which can be expressed as: Adstock_today = Spend_today + decay_rate * Adstock_yesterday. The decay_rate (a value between 0 and 1) is a parameter learned by
  • The Hill Effect: This captures the non-linear law of diminishing returns. Pumping infinite money into a channel won’t produce infinite results. The adstocked spend is fed into a saturation function, typically the Hill function. In prose, the relationship is: Media_Effect = Max_Effect * (Adstock^Slope) / (Adstock^Slope + EC50^Slope). The three parameters learned for each channel are fascinating:
    1. Max_Effect (or beta_max): The asymptotic contribution of the channel. This is the maximum impact this channel can have, regardless of spend.
    2. EC50: The half-saturation point. This is the level of adstock required to achieve 50% of the Max_Effect. It is the inflection point on the S-curve and the key indicator of when returns begin to seriously diminish.
    3. Slope: Controls the steepness of the S-curve. A low slope indicates a very gradual response to spend, while a high slope suggests a more “on/off” threshold effect.
  • Sequential Cross-Validation (SCV) is one of Meridian’s biggest differentiators. Traditional MMMs rely only on in-sample fit, which often leads to overfitting and inflated ROIs that don’t generalize to future months.

SCV solves this by training multiple models across expanding time windows—simulating how well the model would have predicted the future if it were used historically.

This produces:

  • More stable ROI estimates
  • More reliable saturation curves
  • Greater confidence for planning and forecasting
  • Models that generalize to real-world future conditions

With SCV, marketers get measurements that hold up under forward-looking conditions, not just the past.


  • Mass percentage: Meridian allows flexible control over how much the model should trust historical data versus prior knowledge, like MMT results, industry benchmarks or previous MMM cycles.

This is done using a parameter called mass_pct, which acts like a “confidence weight” for each channel.

Channels with noisy spend or inconsistent flights receive a higher mass_pct, meaning the priors guide the results more strongly.

Channels with rich variation and clean data receive a lower mass_pct, meaning the data speaks more loudly.

This ensures every channel is measured with the right level of stability and realism, especially when some media channels have thin or irregular history.

Our Editorial Standards

Reviewed for Accuracy

Every piece is fact-checked for precision.

Up-to-Date Research

We reflect the latest trends and insights.

Credible References

 Backed by trusted industry sources.

Actionable & Insight-Driven

Strategic takeaways for real results.