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

◆ inv_chi_square_lpdf() [1/3]

template<bool propto, typename T_y_cl , typename T_dof_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_dof_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_dof_cl > * = nullptr>
return_type_t< T_y_cl, T_dof_cl > stan::math::inv_chi_square_lpdf ( const T_y_cl &  y,
const T_dof_cl &  nu 
)

The log of an inverse chi-squared density for y with the specified degrees of freedom parameter.

The degrees of freedom parameter must be greater than 0. y must be greater than 0.

\begin{eqnarray*} y &\sim& \mbox{\sf{Inv-}}\chi^2_\nu \\ \log (p (y \, |\, \nu)) &=& \log \left( \frac{2^{-\nu / 2}}{\Gamma (\nu / 2)} y^{- (\nu / 2 + 1)} \exp^{-1 / (2y)} \right) \\ &=& - \frac{\nu}{2} \log(2) - \log (\Gamma (\nu / 2)) - (\frac{\nu}{2} + 1) \log(y) - \frac{1}{2y} \\ & & \mathrm{ where } \; y > 0 \end{eqnarray*}

Template Parameters
T_ytype of scalar
T_dof_cltype of degrees of freedom
Parameters
yA scalar variable.
nuDegrees of freedom.
Exceptions
std::domain_errorif nu is not greater than or equal to 0
std::domain_errorif y is not greater than or equal to 0.

Definition at line 44 of file inv_chi_square_lpdf.hpp.