Join the newly launched
Discord community for real-time discussions, peer support, and direct interaction with the Meridian team!
Set the max_lag parameter
Stay organized with collections
Save and categorize content based on your preferences.
The Meridian model allows for media at time \(t\) to affect the KPI at
times \(t, t + 1, \dots , t + L\) where the integer \(L\) is a
hyperparameter set by the user using max_lag
of ModelSpec
. Media can
potentially have a long effect that can go beyond max_lag
. However, the lagged
effect of media converges towards zero, due to the model assumption of geometric
decay.
In practice, max_lag
is used to truncate how long media can have
an effect because it has positive benefits including improved model
convergence, reasonable model runtimes, and maximizing data usage (reducing
variance). Keeping the max_lag
in the 2-10 range leads to a good balance of
these advantages and disadvantages.
Increasing max_lag
doesn't necessarily mean that ROI estimates
will also increase. One reason for this is because if the media at time \(t\)
can affect the KPI at time \(t+L\), this can take away from the effect of
media at times \(t+1, \dots , t+L\) on the KPI at time \(t+L\).
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.
[null,null,["Last updated 2025-06-11 UTC."],[[["\u003cp\u003eThe Meridian model assumes media impact on KPIs can extend over a period, defined by \u003ccode\u003emax_lag\u003c/code\u003e, with the effect diminishing over time due to geometric decay.\u003c/p\u003e\n"],["\u003cp\u003eWhile media impact can theoretically last longer than \u003ccode\u003emax_lag\u003c/code\u003e, it's truncated for practical reasons like model convergence, runtime, and data utilization.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003emax_lag\u003c/code\u003e value between 2 and 10 generally provides an optimal balance between model performance and efficiency.\u003c/p\u003e\n"],["\u003cp\u003eIncreasing \u003ccode\u003emax_lag\u003c/code\u003e might not result in higher ROI estimates, as it can redistribute the attributed impact across different media exposures over time.\u003c/p\u003e\n"]]],[],null,["# Set the max_lag parameter\n\nThe Meridian model allows for media at time \\\\(t\\\\) to affect the KPI at\ntimes \\\\(t, t + 1, \\\\dots , t + L\\\\) where the integer \\\\(L\\\\) is a\nhyperparameter set by the user using `max_lag` of `ModelSpec`. Media can\npotentially have a long effect that can go beyond `max_lag`. However, the lagged\neffect of media converges towards zero, due to the model assumption of geometric\ndecay.\n\nIn practice, `max_lag` is used to truncate how long media can have\nan effect because it has positive benefits including improved model\nconvergence, reasonable model runtimes, and maximizing data usage (reducing\nvariance). Keeping the `max_lag` in the 2-10 range leads to a good balance of\nthese advantages and disadvantages.\n\nIncreasing `max_lag` doesn't necessarily mean that ROI estimates\nwill also increase. One reason for this is because if the media at time \\\\(t\\\\)\ncan affect the KPI at time \\\\(t+L\\\\), this can take away from the effect of\nmedia at times \\\\(t+1, \\\\dots , t+L\\\\) on the KPI at time \\\\(t+L\\\\)."]]