weibull_adstock#

pymc_marketing.mmm.transformers.weibull_adstock(x, lam=1, k=1, l_max=12, axis=0, mode=ConvMode.After, type=WeibullType.PDF)[source]#

Weibull Adstocking Transformation.

This transformation is similar to geometric adstock transformation but has more degrees of freedom, adding more flexibility.

(Source code, png, hires.png, pdf)

../../_images/pymc_marketing-mmm-transformers-weibull_adstock-1.png
Parameters:
  • x (tensor) – Input tensor.

  • lam (float, by default 1.) – Scale parameter of the Weibull distribution. Must be positive.

  • k (float, by default 1.) – Shape parameter of the Weibull distribution. Must be positive.

  • l_max (int, by default 12) – Maximum duration of carryover effect.

  • axis (int) – The axis of x along witch to apply the convolution

  • mode (ConvMode, optional) –

    The convolution mode determines how the convolution is applied at the boundaries of the input signal, denoted as “x.” The default mode is ConvMode.Before.

    • ConvMode.After: Applies the convolution with the “Adstock” effect, resulting in a trailing decay effect.

    • ConvMode.Before: Applies the convolution with the “Excitement” effect, creating a leading effect

      similar to the wow factor.

    • ConvMode.Overlap: Applies the convolution with both “Pull-Forward” and “Pull-Backward” effects,

      where the effect overlaps with both preceding and succeeding elements.

  • type (WeibullType or str, by default WeibullType.PDF) – Type of Weibull adstock transformation to be applied (PDF or CDF).

Returns:

Transformed tensor based on Weibull adstock transformation.

Return type:

tensor