GeometricAdstock#
- class pymc_marketing.mmm.components.adstock.GeometricAdstock(l_max=FieldInfo(annotation=int, required=True, description='Maximum lag for the adstock transformation.', metadata=[Gt(gt=0)]), normalize=FieldInfo(annotation=bool, required=False, default=True, description='Whether to normalize the adstock values.'), mode=FieldInfo(annotation=ConvMode, required=False, default=<ConvMode.After: 'After'>, description='Convolution mode.'), priors=FieldInfo(annotation=Union[dict[str, Annotated[Prior, InstanceOf]], NoneType], required=False, default=None, description='Priors for the parameters.'), prefix=FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Prefix for the parameters.'))[source]#
Wrapper around geometric adstock function.
For more information, see
pymc_marketing.mmm.transformers.geometric_adstock().(
Source code,png,hires.png,pdf)
Methods
GeometricAdstock.__init__([l_max, ...])GeometricAdstock.apply(x[, dims])Called within a model context.
GeometricAdstock.function(x, alpha)GeometricAdstock.plot_curve(curve[, ...])Plot curve HDI and samples.
GeometricAdstock.plot_curve_hdi(curve[, ...])Plot the HDI of the curve.
GeometricAdstock.plot_curve_samples(curve[, ...])Plot samples from the curve.
GeometricAdstock.sample_curve(parameters[, ...])Sample the adstock transformation given parameters.
GeometricAdstock.sample_prior([coords])Sample the priors for the transformation.
Convert the adstock transformation to a dictionary.
GeometricAdstock.update_priors(priors)Helper to update the priors for a function after initialization.
Attributes
default_priorsfunction_priorslookup_namemodel_configMapping from variable name to prior for the model.
prefixvariable_mappingMapping from parameter name to variable name in the model.