Student's t-distribution (source code)

= Student's t-distribution
{c}
{title2=$t_\nu,\quad \nu>0$}
{wiki}

= Student t-distribution
{c}
{synonym}

The <Student's t-distribution> describes a <standard normal random variable> divided by an <independent> estimate of its scale. For any real $\nu>0$, let $Z\sim N(0,1)$ have the <standard normal distribution> and let $V\sim\chi^2_\nu$ have the <chi-squared distribution>, with $Z$ and $V$ <independent>. Then
$$
T=\frac{Z}{\sqrt{V/\nu}}\sim t_\nu.
$$
The parameter $\nu$ is called the number of <statistical degrees of freedom>. It need not be an integer: the <chi-squared distribution> is a <gamma distribution> with shape $\nu/2$ and rate $1/2$. The <independence> assumption is essential; specifying only the two <marginal distributions> does not determine the <probability distribution> of their ratio.

Its <probability density function> on the whole <real line> is
$$
f_\nu(t)=\frac{\Gamma((\nu+1)/2)}{\sqrt{\nu\pi}\,\Gamma(\nu/2)}\left(1+\frac{t^2}{\nu}\right)^{-(\nu+1)/2},\qquad -\infty<t<\infty,
$$
where $\Gamma$ is the <gamma function>. Every member is a <symmetric distribution> about zero. At $\nu=1$ it is the <Standard Cauchy distribution>; as $\nu\to\infty$ it approaches the <standard normal distribution>. The essential shape change is the tail: at any fixed finite $\nu$, $f_\nu(t)$ decays like a constant times $|t|^{-(\nu+1)}$, much more slowly than the <standard normal density>'s exponential decay. Thus it is a <heavy-tailed distribution>. <NIST and SEMATECH e-Handbook of Statistical Methods/1.3.6.6.4. t Distribution>[NIST and SEMATECH e-Handbook of Statistical Methods; NIST/SEMATECH e-Handbook, Section 1.3.6.6.4: density, Cauchy special case and normal limit; the ratio derivation here also permits noninteger degrees of freedom]{ref}

\Image[/student-t-density-families.png]
{title=Student t densities with 1, 3 and 10 degrees of freedom compared with the standard normal density}

The left panel shows the centers; the right panel uses a <logarithmic scale> to reveal the tails that a linear plot hides. All four curves have location zero and scale one. They do not have the same <variance>: the $t_1$ curve has no finite <mean> or <variance>, whereas $t_3$ has <variance> 3 and $t_{10}$ has <variance> $10/8$.

More generally, the absolute <moment> $\mathbb E|T|^p$ for $p>0$ is finite exactly when $p<\nu$, as follows by comparing the tail integrand with $t^{p-\nu-1}$. Consequently
$$
\mathbb E[T]=0\quad(\nu>1),\qquad \operatorname{Var}(T)=\frac{\nu}{\nu-2}\quad(\nu>2).
$$
For $0<\nu\leq1$ there is no finite <mean>; symmetry alone cannot supply one. For $1<\nu\leq2$ the <mean> exists but the <variance> is infinite. For $0<\nu\leq1$ even the centered definition of <variance> is unavailable because the <mean> does not exist.

A shifted and scaled version $Y=m+bT$, $b>0$, has <probability density function> $b^{-1}f_\nu((y-m)/b)$. The scale $b$ is not its <standard deviation>: for $\nu>2$,
$$
\operatorname{SD}(Y)=b\sqrt{\frac{\nu}{\nu-2}}.
$$
For example, $\nu=3$ and scale $b=2$ give <standard deviation> $2\sqrt3$, rather than 2. The distinction matters when using a <Student's t-distribution> to model data with occasional extreme values, as well as when interpreting a <Student t confidence interval>.