Stan Math Library
4.9.0
Automatic Differentiation
|
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*}
T_y | type of scalar |
T_dof | type of degrees of freedom |
T_loc | type of location |
T_scale | type of scale |
y | A scalar variable. |
nu | Degrees of freedom. |
mu | The mean of the Student-t distribution. |
sigma | The scale parameter of the Student-t distribution. |
std::domain_error | if sigma is not greater than 0. |
std::domain_error | if nu is not greater than 0. |
Definition at line 59 of file student_t_lpdf.hpp.