delayed_adstock#
- pymc_marketing.mmm.transformers.delayed_adstock(x, alpha=0.0, theta=0, l_max=12, normalize=False, axis=0, mode=ConvMode.After)[source]#
Delayed adstock transformation.
This transformation is similar to geometric adstock transformation, but it allows for a delayed peak of the effect. The peak is assumed to occur at
theta
.(
Source code
,png
,hires.png
,pdf
)- Parameters:
- x
tensor
Input tensor.
- alpha
float
,by
default 0.0 Retention rate of ad effect. Must be between 0 and 1.
- theta
float
,by
default 0 Delay of the peak effect. Must be between 0 and
l_max
- 1.- l_max
int
,by
default 12 Maximum duration of carryover effect.
- normalizebool,
by
defaultFalse
Whether to normalize the weights.
- 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.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.
- x
- Returns:
tensor
Transformed tensor.
References
[1]Jin, Yuxue, et al. “Bayesian methods for media mix modeling with carryover and shape effects.” (2017).