adstock#
Adstock transformations for MMM.
Each of these transformations is a subclass of
pymc_marketing.mmm.components.adstock.AdstockTransformation
and defines a function that takes a time series and returns the adstocked
version of it. The parameters of the function are the parameters
of the adstock transformation.
Examples#
Create a new adstock transformation:
from pymc_marketing.mmm import AdstockTransformation
from pymc_marketing.prior import Prior
class MyAdstock(AdstockTransformation):
lookup_name: str = "my_adstock"
def function(self, x, alpha):
return x * alpha
default_priors = {"alpha": Prior("HalfNormal", sigma=1)}
Plot the default priors for an adstock transformation:
from pymc_marketing.mmm import GeometricAdstock
import matplotlib.pyplot as plt
adstock = GeometricAdstock(l_max=15)
prior = adstock.sample_prior()
curve = adstock.sample_curve(prior)
adstock.plot_curve(curve)
plt.show()
Functions
|
Create an adstock transformation from a dictionary. |
Classes
|
Subclass for all adstock functions. |
|
Wrapper around delayed adstock function. |
|
Wrapper around geometric adstock function. |
|
Wrapper around weibull adstock with CDF function. |
|
Wrapper around weibull adstock with PDF function. |