Participe da nova comunidade do
Discord para discussões em tempo real, suporte de colegas e interação direta com a equipe do Meridian.
Definir o parâmetro "max_lag"
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
O modelo do Meridian permite que a mídia no tempo \(t\) afete o KPI nos períodos \(t, t + 1, \dots , t + L\) em que o número inteiro \(L\) é um hiperparâmetro definido pelo usuário com max_lag
de ModelSpec
. A mídia pode ter um efeito de longo prazo que vai além de max_lag
. No entanto, o efeito atrasado da mídia converge para zero, devido à premissa do modelo de decaimento geométrico.
Na prática, max_lag
é usado para truncar o período do efeito da mídia porque tem benefícios positivos, incluindo convergência do modelo aprimorada, tempos de execução do modelo razoáveis e o maximização do uso de dados (reduzindo a variância). Manter max_lag
no intervalo de 2 a 10 leva a um bom equilíbrio entre essas vantagens e desvantagens.
Aumentar max_lag
não significa necessariamente que as estimativas de ROI também vão subir. Isso acontece porque, se a mídia no tempo \(t\)pode afetar o KPI no tempo \(t+L\), o efeito da mídia nos tempos \(t+1, \dots , t+L\) no KPI no tempo \(t+L\)pode ser eliminado.
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2025-08-04 UTC.
[null,null,["Última atualização 2025-08-04 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,["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)."]]