Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ scaled_inv_chi_square_lpdf() [2/3]

template<bool propto, typename T_y , typename T_dof , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_dof, T_scale > * = nullptr>
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*}

Template Parameters
T_ytype of scalar
T_doftype of degrees of freedom
T_Scaletype of scale
Parameters
yA scalar variable.
nuDegrees of freedom.
sScale parameter.
Exceptions
std::domain_errorif nu is not greater than 0
std::domain_errorif s is not greater than 0.
std::domain_errorif y is not greater than 0.

Definition at line 47 of file scaled_inv_chi_square_lpdf.hpp.