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)
- Parameters:
- x
tensor Input tensor.
- lam
float,bydefault 1. Scale parameter of the Weibull distribution. Must be positive.
- k
float,bydefault 1. Shape parameter of the Weibull distribution. Must be positive.
- l_max
int,bydefault 12 Maximum duration of carryover effect.
- axis
int The axis of
xalong 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.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.
- type
WeibullTypeorstr,bydefaultWeibullType.PDF Type of Weibull adstock transformation to be applied (PDF or CDF).
- normalizebool,
bydefaultFalse Whether to normalize the weights.
- x
- Returns:
tensorTransformed tensor based on Weibull adstock transformation.