glearn.priors.BetaPrime.pdf_jacobian#
- BetaPrime.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} (1+\theta)^{-(\alpha+\beta)}} {B(\alpha, \beta)} \left(\frac{a}{\theta} + \frac{b}{\theta + 1} \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 with the shape parameter \(\alpha=2\) and rate parameter \(\beta=4\).
>>> from glearn import priors >>> prior = priors.BetaPrime(2, 4) >>> # Evaluate the Jacobian of the PDF >>> t = [0, 0.5, 1] >>> prior.pdf_jacobian(t) array([ nan, -1.7558299, -0.625 ])