glearn.priors.StudentT.pdf_hessian#

StudentT.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 \nu) = -\frac{\Gamma(\nu')}{\sqrt{\nu \pi} \Gamma(\frac{\nu}{2})} \frac{\nu'}{\nu} \left( z^{-\nu'-1} - (\nu+1) z^{-\nu'-2} \frac{2 \theta^2}{\nu} \right).\]

where \(\nu' = \frac{1 + \nu}{2}\), \(\Gamma\) is the Gamma function, and

\[z = 1 + \frac{\theta^2}{\nu}.\]

If half is True, the above function is doubled.

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

Examples

Create the Student’ t-distribution with the degrees of freedom \(\nu=4\).

>>> from glearn import priors
>>> prior = priors.StudentT(4)

>>> # Evaluate the Hessian of the PDF
>>> t = [0, 0.5, 1]
>>> prior.pdf_hessian(t)
array([[-0.46875   ,  0.        ,  0.        ],
       [ 0.        , -0.22301859,  0.        ],
       [ 0.        ,  0.        ,  0.08586501]])