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

◆ student_t_lpdf() [2/3]

template<bool propto, typename T_y , typename T_dof , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_dof, T_loc, T_scale > * = nullptr>
return_type_t< T_y, T_dof, T_loc, T_scale > stan::math::student_t_lpdf ( const T_y &  y,
const T_dof &  nu,
const T_loc &  mu,
const T_scale &  sigma 
)

The log of the Student-t density for the given y, nu, mean, and scale parameter.

The scale parameter must be greater than 0.

\begin{eqnarray*} y &\sim& t_{\nu} (\mu, \sigma^2) \\ \log (p (y \, |\, \nu, \mu, \sigma) ) &=& \log \left( \frac{\Gamma((\nu + 1) /2)} {\Gamma(\nu/2)\sqrt{\nu \pi} \sigma} \left( 1 + \frac{1}{\nu} (\frac{y - \mu}{\sigma})^2 \right)^{-(\nu + 1)/2} \right) \\ &=& \log( \Gamma( (\nu+1)/2 )) - \log (\Gamma (\nu/2) - \frac{1}{2} \log(\nu \pi) - \log(\sigma) -\frac{\nu + 1}{2} \log (1 + \frac{1}{\nu} (\frac{y - \mu}{\sigma})^2) \end{eqnarray*}

Template Parameters
T_ytype of scalar
T_doftype of degrees of freedom
T_loctype of location
T_scaletype of scale
Parameters
yA scalar variable.
nuDegrees of freedom.
muThe mean of the Student-t distribution.
sigmaThe scale parameter of the Student-t distribution.
Returns
The log of the Student-t density at y.
Exceptions
std::domain_errorif sigma is not greater than 0.
std::domain_errorif nu is not greater than 0.

Definition at line 59 of file student_t_lpdf.hpp.