Únete a la comunidad recientemente lanzada de
Discord para participar en debates en tiempo real, obtener asistencia de otros miembros y comunicarte directamente con el equipo de Meridian.
Cómo establecer el parámetro max_lag
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
El modelo Meridian permite que los medios en el momento \(t\) afecten el KPI en los momentos \(t, t + 1, \dots , t + L\) , en los que el número entero \(L\) es un hiperparámetro establecido por el usuario con max_lag
de ModelSpec
. Los medios pueden tener un efecto duradero más allá de max_lag
. Sin embargo, el efecto rezagado de los medios converge hacia cero debido a la suposición del modelo de decaimiento geométrico.
En la práctica, max_lag
se utiliza para truncar el tiempo que dura el efecto de los medios, ya que ofrece beneficios como una mejor convergencia del modelo, tiempos de ejecución razonables del modelo y una maximización del uso de datos (reducción de la varianza). Mantener el max_lag
en el rango de 2 a 10 genera un buen equilibrio entre estas ventajas y desventajas.
Un mayor max_lag
no siempre significa que las estimaciones del ROI también aumentarán. Uno de los motivos es que, si los medios en el momento \(t\)pueden afectar el KPI en el momento \(t+L\), esto puede eliminar el efecto del medios en los momentos \(t+1, \dots , t+L\) sobre el KPI en el momento \(t+L\).
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-08-04 (UTC)
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Falta la información que necesito","missingTheInformationINeed","thumb-down"],["Muy complicado o demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Desactualizado","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema con las muestras o los códigos","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 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)."]]