Student-t distribution


Story

The story of the Student-t distribution largely derives from its relationships with other distributions. One way to think about it is as like the Normal distribution with heavier tails.


Parameters

The Student-t distribution is symmetrically peaked, and its peak is located at \(\mu\), the location paramter. The peak’s width is dictated by scale parameter \(\sigma\), which is positive. Finally, the shape parameter, called “degrees of freedom,” is \(\nu\). This last parameter imparts the distribution with heavy tails for small \(\nu\).


Support

The Student-t distribution is supported on the set of real numbers.


Probability density function

\[\begin{align} f(y;\nu, \mu, \sigma) = \frac{\Gamma\left(\frac{\nu+1}{2}\right)}{\Gamma\left(\frac{\nu}{2}\right)\sqrt{\pi \nu \sigma^2}}\left(1 + \frac{(y-\mu)^2}{\nu \sigma^2}\right)^{-\frac{\nu + 1}{2}}. \end{align}\]

Moments

Mean: \(\mu\) for \(\nu > 1\), otherwise undefined.

Variance: \(\displaystyle{\frac{\nu}{\nu - 2}}\) for \(\nu > 2\). If \(1 < \nu < 2\), then the variance is infinite. If \(\nu \le 1\), the variance is undefined.


Usage

Package

Syntax

NumPy

mu + sigma * rg.standard_t(nu)

SciPy

scipy.stats.t(nu, mu, sigma)

Stan

student_t(nu, mu, sigma)



Notes

  • Only the standard Student-t distribution (\(\mu = 0\) and \(\sigma = 1\)) is available in NumPy. You can still draw out of the Student-t distribution by performing a transformation on the samples out of the standard Student-t distribution, as shown in the usage, above.


PDF and CDF plots