ModifiedHalfNormal#

class cuqi.distribution.ModifiedHalfNormal(alpha=None, beta=None, gamma=None, is_symmetric=False, **kwargs)#

Represents a modified half-normal (MHN) distribution, a three-parameter family of distributions generalizing the Gamma distribution. The distribution is continuous with pdf

\[f(x; \alpha, \beta, \gamma) \propto x^{(\alpha-1)} * \exp(-\beta * x^2 + \gamma * x)\]

The MHN generalizes the half-normal distribution, because \(f(x; 1, \beta, 0) \propto \exp(-\beta * x^2)\)

The MHN generalizes the gamma distribution because \(f(x; \alpha, 0, -\gamma) \propto x^{(\alpha-1)} * \exp(- \gamma * x)\)

Reference: [1] Sun, et al. “The Modified-Half-Normal distribution: Properties and an efficient sampling scheme.” Communications in Statistics-Theory and Methods

Parameters:
  • alpha (float) – The polynomial exponent parameter \(\alpha\) of the MHN distribution. Must be positive.

  • beta (float) – The quadratic exponential parameter \(\beta\) of the MHN distribution. Must be positive.

  • gamma (float) – The linear exponential parameter \(\gamma\) of the MHN distribution.

__init__(alpha=None, beta=None, gamma=None, is_symmetric=False, **kwargs)#

Initialize the core properties of the distribution.

Parameters:
  • name (str, default None) – Name of distribution.

  • geometry (Geometry, default _DefaultGeometry (or None)) – Geometry of distribution.

  • is_symmetric (bool, default None) – Indicator if distribution is symmetric.

Methods

__init__([alpha, beta, gamma, is_symmetric])

Initialize the core properties of the distribution.

disable_FD()

Disable finite difference approximation for logd gradient.

enable_FD([epsilon])

Enable finite difference approximation for logd gradient.

get_conditioning_variables()

Return the conditioning variables of this distribution (if any).

get_mutable_variables()

Return any public variable that is mutable (attribute or property) except those in the ignore_vars list

get_parameter_names()

Returns the names of the parameters that the density can be evaluated at or conditioned on.

gradient(*args, **kwargs)

Returns the gradient of the log density at x.

logd(*args, **kwargs)

Evaluate the un-normalized log density function of the distribution.

logpdf(x)

Evaluate the log probability density function of the distribution.

pdf(x)

Evaluate the log probability density function of the distribution.

sample([N])

Sample from the distribution.

to_likelihood(data)

Convert conditional distribution to a likelihood function given observed data

Attributes

FD_enabled

Returns True if finite difference approximation of the logd gradient is enabled.

FD_epsilon

Spacing for the finite difference approximation of the logd gradient.

alpha

The polynomial exponent parameter of the MHN distribution.

beta

The quadratic exponential parameter of the MHN distribution.

dim

Return the dimension of the distribution based on the geometry.

gamma

The linear exponential parameter of the MHN distribution.

geometry

Return the geometry of the distribution.

is_cond

Returns True if instance (self) is a conditional distribution.

name

Name of the random variable associated with the density.

shape

The polynomial exponent parameter of the MHN distribution.