glearn.priors.Normal.log_pdf#

Normal.log_pdf(hyperparam)#

Logarithm of the probability density function of the prior distribution.

Parameters:
xfloat or array_like[float]

Input hyperparameter or an array of hyperparameters.

Returns:
pdffloat or array_like[float]

The logarithm of probability density function of the input hyperparameter(s).

Notes

This function returns logp(θ).

Multiple hyperparameters:

When an array of hyperparameters θ=(θ,,θn) are given, it is assumed that prior for each hyperparameter is independent of others. The output of this function is then the sum of all log-probabilities

i=1nlogp(θi).

Using Log Scale:

If the attribute use_log_scale is True, it is assumed that the input argument θ is the log of the hyperparameter, so to convert back to the original hyperparameter, the transformation below is performed

θ10θ.

Examples

Create the inverse Gamma distribution with the shape parameter α=4 and rate parameter β=2.

>>>
>>> from glearn import priors
>>> prior = priors.InverseGamma(4, 2)

>>> # Evaluate the log-PDF
>>> prior.log_pdf(t)
-17.15935597045384