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

◆ scaled_inv_chi_square_lpdf() [1/3]

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

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_y_cltype of random variable
T_dof_cltype of degrees of freedom
T_Scale_cltype of scale
Parameters
yrandom 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 43 of file scaled_inv_chi_square_lpdf.hpp.