WeibullPDFAdstock#

class pymc_marketing.mmm.components.adstock.WeibullPDFAdstock(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, Union[Annotated[Prior, InstanceOf], float, Annotated[TensorVariable, InstanceOf], Annotated[VariableFactory, 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 weibull adstock with PDF function.

For more information, see pymc_marketing.mmm.transformers.weibull_adstock().

(Source code, png, hires.png, pdf)

../../_images/pymc_marketing-mmm-components-adstock-WeibullPDFAdstock-1.png

Methods

WeibullPDFAdstock.__init__([l_max, ...])

WeibullPDFAdstock.apply(x[, dims])

Call within a model context.

WeibullPDFAdstock.function(x, lam, k)

Weibull adstock function.

WeibullPDFAdstock.plot_curve(curve[, ...])

Plot curve HDI and samples.

WeibullPDFAdstock.plot_curve_hdi(curve[, ...])

Plot the HDI of the curve.

WeibullPDFAdstock.plot_curve_samples(curve)

Plot samples from the curve.

WeibullPDFAdstock.sample_curve(parameters[, ...])

Sample the adstock transformation given parameters.

WeibullPDFAdstock.sample_prior([coords])

Sample the priors for the transformation.

WeibullPDFAdstock.set_dims_for_all_priors(dims)

Set the dims for all priors.

WeibullPDFAdstock.to_dict()

Convert the adstock transformation to a dictionary.

WeibullPDFAdstock.update_priors(priors)

Update the priors for a function after initialization.

Attributes

combined_dims

Get the combined dims for all the parameters.

default_priors

function_priors

Get the priors for the function.

lookup_name

model_config

Mapping from variable name to prior for the model.

prefix

variable_mapping

Mapping from parameter name to variable name in the model.