HalfGaussianBasis#

class pymc_marketing.mmm.events.HalfGaussianBasis(mode='after', include_event=True, **kwargs)[source]#

One-sided Gaussian basis transformation.

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

../../_images/pymc_marketing-mmm-events-HalfGaussianBasis-1.png
Parameters:
modeLiteral[“after”, “before”]

Whether the basis is located before or after the event.

include_eventbool

Whether to include the event days in the basis.

priorsdict[str, Prior]

Prior for the sigma parameter.

prefixstr

Prefix for the parameter names.

Methods

HalfGaussianBasis.__init__([mode, include_event])

HalfGaussianBasis.apply(x[, dims, idx])

Call within a model context.

HalfGaussianBasis.function(x, sigma)

One-sided Gaussian bump function.

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

Plot curve HDI and samples.

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

Plot the HDI of the curve.

HalfGaussianBasis.plot_curve_samples(curve)

Plot samples from the curve.

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

Sample the curve of the saturation transformation given parameters.

HalfGaussianBasis.sample_prior([coords])

Sample the priors for the transformation.

HalfGaussianBasis.set_dims_for_all_priors(dims)

Set the dims for all priors.

HalfGaussianBasis.to_dict()

Convert the half Gaussian basis to a dictionary.

HalfGaussianBasis.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.