weibull_adstock#

pymc_marketing.mmm.transformers.weibull_adstock(x, lam=1, k=1, l_max=12, axis=0, mode=ConvMode.After, type=WeibullType.PDF, normalize=False)[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:
xtensor

Input tensor.

lamfloat, by default 1.

Scale parameter of the Weibull distribution. Must be positive.

kfloat, by default 1.

Shape parameter of the Weibull distribution. Must be positive.

l_maxint, by default 12

Maximum duration of carryover effect.

axisint

The axis of x along witch to apply the convolution

modeConvMode, 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.After.

  • 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.

typeWeibullType or str, by default WeibullType.PDF

Type of Weibull adstock transformation to be applied (PDF or CDF).

normalizebool, by default False

Whether to normalize the weights.

Returns:
tensor

Transformed tensor based on Weibull adstock transformation.