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

◆ student_t_lpdf() [1/3]

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

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_y_cltype of scalar
T_dof_cltype of degrees of freedom
T_loc_cltype of location
T_scale_cltype 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 51 of file student_t_lpdf.hpp.