glearn.priors.BetaPrime.pdf_hessian#
- BetaPrime.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).
See also
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} (1+\theta)^{-(\alpha+\beta)}} {B(\alpha, \beta)} \left(\frac{a^2}{\theta^2} -\frac{a}{\theta^2} + \frac{2ab}{\theta (\theta+1)} + \frac{b^2}{(\theta+1)^2} - \frac{b}{(\theta+1)^2} \right),\]where \(B\) is the Beta function, \(a = \alpha-1\), and \(b = -(\alpha + \beta)\).
When an array of hyperparameters are given, it is assumed that prior for each hyperparameter is independent of others.
Examples
Create the beta prime distribution shape parameter \(\alpha=2\) and rate parameter \(\beta=4\).
>>> from glearn import priors >>> prior = priors.BetaPrime(2, 4) >>> # Evaluate the Hessian of the PDF >>> t = [0, 0.5, 1] >>> prior.pdf_hessian(t) array([[ nan, 0. , 0. ], [0. , 2.34110654, 0. ], [0. , 0. , 1.40625 ]])