Stan Math Library
4.9.0
Automatic Differentiation
|
return_type_t< T_y, T_dof, T_scale > stan::math::scaled_inv_chi_square_lpdf | ( | const T_y & | y, |
const T_dof & | nu, | ||
const T_scale & | s | ||
) |
The log of a scaled inverse chi-squared density for y with the specified degrees of freedom parameter and scale parameter.
\begin{eqnarray*} y &\sim& \mbox{\sf{Inv-}}\chi^2(\nu, s^2) \\ \log (p (y \, |\, \nu, s)) &=& \log \left( \frac{(\nu / 2)^{\nu / 2}}{\Gamma (\nu / 2)} s^\nu y^{- (\nu / 2 + 1)} \exp^{-\nu s^2 / (2y)} \right) \\ &=& \frac{\nu}{2} \log(\frac{\nu}{2}) - \log (\Gamma (\nu / 2)) + \nu \log(s) - (\frac{\nu}{2} + 1) \log(y) - \frac{\nu s^2}{2y} \\ & & \mathrm{ where } \; y > 0 \end{eqnarray*}
T_y | type of scalar |
T_dof | type of degrees of freedom |
T_Scale | type of scale |
y | A scalar variable. |
nu | Degrees of freedom. |
s | Scale parameter. |
std::domain_error | if nu is not greater than 0 |
std::domain_error | if s is not greater than 0. |
std::domain_error | if y is not greater than 0. |
Definition at line 47 of file scaled_inv_chi_square_lpdf.hpp.