LaplacePrior#
- class pymc_marketing.special_priors.LaplacePrior(dims=None, centered=True, **parameters)[source]#
A Laplace prior parameterized by a location and a scale parameter.
Unlike the standard Laplace distribution available through the Prior class, this distribution can optionally be centered or non-centered. A non-centered parameterization can sometimes eliminate sampling problems in hierarchical models.
- Parameters:
- mu
Prior,float,int, array_like The location parameter of the distribution.
- b
Prior,float,int, array_like The scale parameter of the distribution.
- dims
tuple[str, …], optional The dimensions of the distribution, by default None.
- centeredbool, optional
Whether to use the centered parameterization, by default True.
- mu
References
A.C. Jones, Scale mixtures of unbounded continuous distributions.
Stan Documentation, Unbounded continuous distributions.
Methods
LaplacePrior.__init__([dims, centered])Create a variable from the prior distribution.
LaplacePrior.from_dict(data)Create a SpecialPrior prior from a dictionary.
LaplacePrior.sample_prior([coords, name])Sample from the prior distribution.
Convert the SpecialPrior to a dictionary.