glearn.priors.Gamma.pdf_jacobian#
- Gamma.pdf_jacobian(x)#
Jacobian of the probability density function of the prior distribution.
- Parameters:
- xfloat or array_like[float]
Input hyperparameter or an array of hyperparameters.
- Returns:
- jacfloat or array_like[float]
The Jacobian of the probability density function of the input hyperparameter(s).
See also
Notes
The first derivative of the probability density function is
\[\frac{\mathrm{d}}{\mathrm{d}\theta} p(\theta \vert \alpha, \beta) = \frac{\theta^{\alpha-1} e^{-\beta \theta} \beta^{\alpha}}{\Gamma(\alpha)} \frac{\alpha-1 -\beta \theta}{\theta},\]where \(\Gamma\) is the Gamma function.
When an array of hyperparameters are given, it is assumed that prior for each hyperparameter is independent of others.
Examples
Create the Gamma distribution with the shape parameter \(\alpha=2\) and rate parameter \(\beta=4\).
>>> from glearn import priors >>> prior = priors.Gamma(2, 4) >>> # Evaluate the Jacobian of the PDF >>> t = [0, 0.5, 1] >>> prior.pdf_jacobian(t) array([ nan, -2.16536453, -0.87915067])