LogNormalPositiveParam#

class pymc_marketing.special_priors.LogNormalPositiveParam(dims=None, centered=True, **parameters)[source]#

A specialized implementation of a log normal distribution.

Like the LogNormal distribution, this distribution has support over the positive numbers. However, unlike the lognormal, the parameters are also specified in the positive domain.

The other advantage of this prior is in constructing hierarchical models. It allows users to toggle between centered and non-centered parameterizations. This enables rapid iteration when searching for a parameterization that samples efficiently.

Parameters:
muPrior, float, int, array_like

The mean of the distribution.

sigmaPrior, float, int, array_like

The standard deviation of the distribution.

dimstuple[str, …], optional

The dimensions of the distribution, by default None.

centeredbool, optional

Whether the distribution is centered, by default True.

Examples

Build a non-centered hierarchical model where information is shared across geos.

Methods

LogNormalPositiveParam.__init__([dims, centered])

LogNormalPositiveParam.create_variable(name)

Create a variable from the prior distribution.

LogNormalPositiveParam.from_dict(data)

Create a LogNormalPositiveParam prior from a dictionary.

LogNormalPositiveParam.sample_prior([...])

Sample from the prior distribution.

LogNormalPositiveParam.to_dict()

Convert the prior distribution to a dictionary.