geometric_adstock#
- pymc_marketing.mmm.transformers.geometric_adstock(x, alpha=0.0, l_max=12, *, dim, normalize=False, mode=ConvMode.After)[source]#
Geometric adstock transformation.
Adstock with geometric decay assumes advertising effect peaks at the same time period as ad exposure. The cumulative media effect is a weighted average of media spend in the current time-period (e.g. week) and previous
l_max- 1 periods (e.g. weeks).l_maxis the maximum duration of carryover effect.(
Source code,png,hires.png,pdf)
- Parameters:
x (
Union[Variable,Sequence[Variable], ArrayLike,XTensorVariable,DataArray]) – Input tensor.alpha (
Union[Variable,Sequence[Variable], ArrayLike,XTensorVariable,DataArray]) – Retention rate of ad effect. Must be between 0 and 1.l_max (
int) – Maximum duration of carryover effect.normalize (
bool) – Whether to normalize the weights.dim (
str) – The dimension of the x input along which to perform the convolution.mode (
ConvMode) –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.
- Return type:
- Returns:
Transformed tensor.
References
[1]Jin, Yuxue, et al. “Bayesian methods for media mix modeling with carryover and shape effects.” (2017).