加入新推出的
Discord 社区,展开实时讨论,获得同行支持,并直接与 Meridian 团队互动!
设置 max_lag 形参
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Meridian 模型允许时间点 \(t\) 的媒体影响时间点 \(t, t + 1, \dots , t + L\) 的 KPI,其中整数 \(L\) 是用户使用 ModelSpec
中的 max_lag
设置的超形参。媒体的影响可能会持续较长时间,超出 max_lag
所设置的时长。不过,由于几何衰减这一模型假设,媒体的滞后效应会趋近于零。
在实际应用中,max_lag
用于截断媒体产生影响的持续时间,因为这可以发挥积极的作用,包括提高模型收敛性、确保合理的模型运行时,以及最大限度地提高数据使用率(减少方差)。将 max_lag
的值保持在 2-10 的范围内,可以在优缺点之间达到良好的平衡。
提高 max_lag
的值并不一定意味着投资回报率估计值也会增加。原因之一是,如果时间点 \(t\)的媒体可以影响时间点 \(t+L\)的 KPI,这可能会削弱时间点 \(t+1, \dots , t+L\) 的媒体对时间点 \(t+L\)的 KPI 的影响。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-04。
[null,null,["最后更新时间 (UTC):2025-08-04。"],[[["\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,["The Meridian model allows for media at time \\\\(t\\\\) to affect the KPI at times\n\\\\(t, t + 1, \\\\dots , t + L\\\\) where the integer \\\\(L\\\\) is a hyperparameter set\nby the user using the `max_lag` parameter of `ModelSpec`. Media can potentially\nhave a long effect that goes beyond `max_lag`. However, Meridian assumes lagged\neffects decay monotonically toward zero and these effects eventually become\nsmall. For practical reasons, we truncate the effect at the `max_lag` value.\n\n`max_lag` tradeoffs\n\nSmaller values of `max_lag` generally lead to improved model convergence and\nfaster model model runtimes. Smaller values of `max_lag` can also reduce model\nvariance: with large `max_lag` values, the amount of data available is often\ninsufficient for Meridian models to precisely estimate lagged effects,\nincreasing model variance. On the other hand, larger values of `max_lag`\nincrease the duration of lagged effects which can be beneficial for models that\nexpect long term effects.\n\nIncreasing `max_lag` doesn't necessarily mean that ROI estimates will also\nincrease. One reason for this is because if the media at time \\\\(t\\\\) can affect\nthe KPI at time \\\\(t+L\\\\), this can take away from the effect of media at times\n\\\\(t+1, \\\\dots , t+L\\\\) on the KPI at time \\\\(t+L\\\\).\n\nPractical advice for setting `max_lag`\n\nThe two adstock decay functions offered in Meridian, geometric and binomial,\nbalance `max_lag` tradeoffs differently.\n\nWhen using geometric decay\n\nWith geometric decay, setting `max_lag` in the 2-10 range leads to a good\nbalance of modeling the lagged effects of media while minimizing the potential\ndisadvantages of a max lag that is too large. The geometric decay curve decays\nto zero very quickly for most values of \\\\(\\\\alpha\\\\), so setting `max_lag` to\na very large value has a negligible effect on the model likelihood.\n\nWhen using binomial decay\n\nWith binomial decay, however, the curve is a function of the max lag: it is\nstretched to cover the effect window as its x-intercept is always at\n\\\\(L + 1\\\\). As a result, the concern of diminishing returns no longer applies\nand you can use binomial decay with a larger value of `max_lag`. However,\nconvergence and model runtimes can still become worse with increasing `max_lag`.\nThis tension should be balanced with potential benefits of increasing `max_lag`,\nand we recommend selecting a `max_lag` value in the 4-20 range in this case.\n\nWhen using a combination of geometric and binomial\n\nDeciding on increasing the value of `max_lag` can be complicated if you are\nusing different decay functions for different channels. If you are predominantly\nusing one function with a small number of exceptions we recommend following the\nrecommendation of the predominant function. If you are using a more balanced\nmix, we recommend selecting a `max_lag` in the 4-20 range. This gives a good\nbalance of binomial lagged effect modeling while avoiding the drawbacks of using\ngeometric with a large `max_lag`.\n\n| Adstock Decay Function | Max Lag Recommendation |\n|--------------------------------|------------------------|\n| Geometric | 2-10 time periods. |\n| Binomial | 4-20 time periods. |\n| Geometric/Binomial Combination | 4-20 time periods. |\n\nFor additional details on the decay functions and alpha prior, see\n[Set the adstock_decay_spec parameter](/meridian/docs/advanced-modeling/set-adstock-decay-spec-parameter)."]]