LogNormalPrior#

class gammapy.modeling.models.LogNormalPrior[source]#

Bases: Prior

Log-normal prior.

Log-normal probability density in the parameter value \(x\):

\[-2 \log p(x) = \left(\frac{\ln(x) - \ln(\mu)}{\sigma}\right)^2 + 2 \ln(x) + 2 \ln(\sigma) + \ln(2\pi)\]

The \(2 \ln(x)\) term is the Jacobian of the change of variable from \(\ln(x)\) to \(x\), so the minimum is at the mode \(\mu e^{-\sigma^2}\), not at mu. This is the appropriate density for a Bayesian prior on x. For a gaussian constraint in log space with its minimum at mu, use LogSpaceGaussianPrior.

Parameters:
mufloat, optional

Median of the distribution. Default is 1.

sigmafloat, optional

Standard deviation of the natural logarithm of the value. Default is 1.

Attributes Summary

default_parameters

mu

Parameter of a Prior.

sigma

Parameter of a Prior.

tag

Methods Summary

evaluate(value, mu, sigma)

Evaluate -2 times the log-normal log-density at value.

Attributes Documentation

default_parameters = <gammapy.modeling.parameter.PriorParameters object>#
mu#

Parameter of a Prior.

A prior is a probability density function of a model parameter and can take different forms, including but not limited to Gaussian distributions and uniform distributions. The prior includes information or knowledge about the dataset or the parameters of the fit.

Parameters:
namestr

Name.

valuefloat or Quantity

Value.

unitUnit or str, optional

Unit. Default is “”.

Examples

For a usage example see Priors tutorial.

sigma#

Parameter of a Prior.

A prior is a probability density function of a model parameter and can take different forms, including but not limited to Gaussian distributions and uniform distributions. The prior includes information or knowledge about the dataset or the parameters of the fit.

Parameters:
namestr

Name.

valuefloat or Quantity

Value.

unitUnit or str, optional

Unit. Default is “”.

Examples

For a usage example see Priors tutorial.

tag = ['LogNormalPrior']#

Methods Documentation

static evaluate(value, mu, sigma)[source]#

Evaluate -2 times the log-normal log-density at value.

__init__(**kwargs)#
classmethod __new__(*args, **kwargs)#