glearn.priors.Erlang.pdf_hessian#

Erlang.pdf_hessian(x)#

Hessian of the probability density function of the prior distribution.

Parameters:
xfloat or array_like[float]

Input hyperparameter or an array of hyperparameters.

Returns:
hessfloat or array_like[float]

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

Notes

The second derivative of the probability density function is

\[\frac{\mathrm{d}^2}{\mathrm{d}\theta^2} p(\theta \vert \alpha, \beta) = \frac{\theta^{\alpha-1} e^{-\beta \theta} \beta^{\alpha}}{(\alpha - 1)!} \frac{(\alpha-1 -\beta \theta)^2 - (\alpha-1)}{\theta^2},\]

When an array of hyperparameters are given, it is assumed that prior for each hyperparameter is independent of others.

Examples

Create the Erlang distribution with the shape parameter \(\alpha=2\) and rate parameter \(\beta=4\).

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

>>> # Evaluate the Hessian of the PDF
>>> t = [0, 0.5, 1]
>>> prior.pdf_hessian(t)
array([[       nan, 0.        , 0.        ],
       [0.        , 0.        , 0.        ],
       [0.        , 0.        , 2.34440178]])