Join the newly launched
Discord community for real-time discussions, peer support, and direct interaction with the Meridian team!
Media saturation and lagging
Stay organized with collections
Save and categorize content based on your preferences.
Typically the effect of a media channel on sales has a lagged effect that tapers
off slowly over time. Meridian's model architecture is designed to
capture this effect through a geometric decay Adstock function. For more
information, see A Hierarchical Bayesian Approach to Improve Media Mix Models
Using Category
Data
and Bayesian Methods for Media Mix Modeling with Carryover and Shape
Effects.
Adstock function
The Adstock function is defined as follows:
$$
\text{AdStock}(x_t, x_{t-1}, \cdots, x_{t-L};\ \alpha)\ =
\dfrac{\sum\limits_{s=0}^L\ \alpha^sx_{t-s}}
{\sum\limits _{s=0}^L\ \alpha^s}
$$
Where:
\(x_s \geq 0; s = t, t-1, \cdots, t-L\)
\(\alpha\ \in\ [0, 1]\) is the geometric decay rate
\(L\) is the maximum lag duration
It is also intuitive that as spending on a given media channel within any given
time period increases, you eventually see diminishing marginal returns, for
example, saturation. Meridian models this saturation effect through a
two-parameter function known as the Hill function.
Hill function
The Hill function is defined as follows:
$$
\text{Hill}(x; ec, \text{slope}) = \frac{1}{1+\left( \frac{x}{ec} \right)^
{- \text{slope}}}
$$
Where:
\(x \geq 0\)
\(ec > 0\) is the half saturation point, meaning that
\(\text{Hill}(x=ec; ec, \text{slope}) = 0.5\)
\(\text{slope} > 0\) is a parameter that controls the function shape:
- \(\text{slope} \leq 1\) corresponds to a concave shape
- \(\text{slope} > 1\) corresponds to an S shaped function that is
convex for \( x < ec \) and concave for \( x > ec \)
Important: The model's estimation of the Hill function parameters is based
on the observed range of media data. The fitted response curve can be
extrapolated outside this range, but results based on extrapolation should be
interpreted with an appropriate level of caution.
The Hill function can be applied either before or after the Adstock
transformation, depending on the boolean hill_before_adstock
argument of the
ModelSpec
. The default setting is hill_before_adstock = False
, which makes
the media effect of channel \(m\) within geo \(g\) and time period \(t\)
equal to
\(\beta_{g,m} \text{Hill}(\text{Adstock}(x_t,x_{t-1},\cdots,x_{t-L};\ \alpha_m)
;ec_m, \text{slope}_m)\).
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-06-11 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-11 UTC."],[[["\u003cp\u003eMeridian utilizes an Adstock function to model the lagged and tapering effects of media channels on sales.\u003c/p\u003e\n"],["\u003cp\u003eThe Hill function is employed to capture the diminishing marginal returns, or saturation, of media spending.\u003c/p\u003e\n"],["\u003cp\u003eThe Hill function can be applied before or after the Adstock transformation, offering flexibility in modeling media effects.\u003c/p\u003e\n"],["\u003cp\u003eThe model estimates parameters based on observed data, and extrapolation beyond this range requires caution in interpretation.\u003c/p\u003e\n"],["\u003cp\u003eDetails on the Adstock and Hill functions, including formulas and parameter explanations, are provided within the content.\u003c/p\u003e\n"]]],["Meridian's model captures the lagged effect of media on sales using a geometric decay Adstock function, defined by decay rate (α) and maximum lag (L). It also accounts for diminishing returns through the Hill function, characterized by half saturation point (ec) and slope. The Hill function can be applied before or after the Adstock transformation, defaulting to after. The model estimates Hill function parameters based on the observed media data range.\n"],null,["# Media saturation and lagging\n\nTypically the effect of a media channel on sales has a lagged effect that tapers\noff slowly over time. Meridian's model architecture is designed to\ncapture this effect through a geometric decay Adstock function. For more\ninformation, see [A Hierarchical Bayesian Approach to Improve Media Mix Models\nUsing Category\nData](https://research.google/pubs/a-hierarchical-bayesian-approach-to-improve-media-mix-models-using-category-data/)\nand [Bayesian Methods for Media Mix Modeling with Carryover and Shape\nEffects](https://research.google/pubs/bayesian-methods-for-media-mix-modeling-with-carryover-and-shape-effects/).\n\nAdstock function\n----------------\n\nThe Adstock function is defined as follows: \n$$ \\\\text{AdStock}(x_t, x_{t-1}, \\\\cdots, x_{t-L};\\\\ \\\\alpha)\\\\ = \\\\dfrac{\\\\sum\\\\limits_{s=0}\\^L\\\\ \\\\alpha\\^sx_{t-s}} {\\\\sum\\\\limits _{s=0}\\^L\\\\ \\\\alpha\\^s} $$\n\nWhere:\n\n- \\\\(x_s \\\\geq 0; s = t, t-1, \\\\cdots, t-L\\\\)\n\n- \\\\(\\\\alpha\\\\ \\\\in\\\\ \\[0, 1\\]\\\\) is the geometric decay rate\n\n- \\\\(L\\\\) is the maximum lag duration\n\nIt is also intuitive that as spending on a given media channel within any given\ntime period increases, you eventually see diminishing marginal returns, for\nexample, saturation. Meridian models this saturation effect through a\ntwo-parameter function known as the Hill function.\n\nHill function\n-------------\n\nThe Hill function is defined as follows: \n$$ \\\\text{Hill}(x; ec, \\\\text{slope}) = \\\\frac{1}{1+\\\\left( \\\\frac{x}{ec} \\\\right)\\^ {- \\\\text{slope}}} $$\n\nWhere:\n\n- \\\\(x \\\\geq 0\\\\)\n\n- \\\\(ec \\\u003e 0\\\\) is the half saturation point, meaning that\n \\\\(\\\\text{Hill}(x=ec; ec, \\\\text{slope}) = 0.5\\\\)\n\n- \\\\(\\\\text{slope} \\\u003e 0\\\\) is a parameter that controls the function shape:\n\n - \\\\(\\\\text{slope} \\\\leq 1\\\\) corresponds to a concave shape\n - \\\\(\\\\text{slope} \\\u003e 1\\\\) corresponds to an *S* shaped function that is convex for \\\\( x \\\u003c ec \\\\) and concave for \\\\( x \\\u003e ec \\\\)\n\n**Important:** The model's estimation of the Hill function parameters is based\non the observed range of media data. The fitted response curve can be\nextrapolated outside this range, but results based on extrapolation should be\ninterpreted with an appropriate level of caution.\n\nThe Hill function can be applied either before or after the Adstock\ntransformation, depending on the boolean `hill_before_adstock` argument of the\n`ModelSpec`. The default setting is `hill_before_adstock = False`, which makes\nthe media effect of channel \\\\(m\\\\) within geo \\\\(g\\\\) and time period \\\\(t\\\\)\nequal to\n\\\\(\\\\beta_{g,m} \\\\text{Hill}(\\\\text{Adstock}(x_t,x_{t-1},\\\\cdots,x_{t-L};\\\\ \\\\alpha_m)\n;ec_m, \\\\text{slope}_m)\\\\)."]]