by Marco Taboga, PhD
The Student's t distribution is a continuous probability distribution that is often encountered in statistics (e.g., in hypothesis tests about the mean).
It arises when a normal random variable is divided by a Chisquare or a Gamma random variable.
Table of contents
How it arises
The standard case
The nonstandard case
The standard Student's t distribution
Definition
Relation to the normal and to the Gamma distribution
Expected value
Variance
Higher moments
Moment generating function
Characteristic function
Distribution function
Student's t distribution in general
Definition
Relation between standard and general
Expected value
Variance
Moment generating function
Characteristic function
Distribution function
More details
Convergence to the normal distribution
Noncentral t distribution
Density plots
Plot 1 Changing the mean
Plot 2  Changing the scale
Plot 3  Changing the degrees of freedom
Solved exercises
Exercise 1
Exercise 2
Exercise 3
References
How it arises
Before going into details, we provide an overview.
The standard case
A variable has a standard Student's t distribution with degrees of freedom if it can be written as a ratio
where:

has a standard normal distribution;

is a Chisquare random variable with degrees of freedom;

and are independent of each other.
A Chisquare variable with degrees of freedom divided by has a Gamma distribution (with parameters and ).
As a consequence, we can also see a standard Student's t distribution with degrees of freedom as a ratio
between a standard normal variable and the square root of a Gamma variable .
The nonstandard case
A variable has a nonstandard Student's t distribution if it can be written as a linear transformation of a standard one:where and are defined as before.
The distribution is characterized by three parameters:

mean ;

scale ;

degrees of freedom .
The standard Student's t distribution
We start from the special case of the standard Student's t distribution.
By first explaining this special case, the exposition of the more general case is greatly facilitated.
Definition
The standard Student's t distribution is characterized as follows.
Definition Let be a continuous random variable. Let its support be the whole set of real numbers:Let . We say that has a standard Student's t distribution with degrees of freedom if and only if its probability density function iswhere is a constant:and is the Beta function.
Usually the number of degrees of freedom is integer (), but it can also be real ().
Relation to the normal and to the Gamma distribution
A standard Student's t random variable can be written as a normal random variable whose variance is equal to the reciprocal of a Gamma random variable, as shown by the following proposition.
Proposition The probability density function of can be written aswhere:

is the probability density function of a normal distribution with mean and variance :

is the probability density function of a Gamma random variable with parameters and :where
Proof
We need to prove thatwhereandLet us start from the integrand function: where and is the probability density function of a random variable having a Gamma distribution with parameters and . Therefore:
If is a zeromean normal random variable with variance , conditional on , then we can think of as a ratiowhere has a standard normal distribution, has a Gamma distribution and and are independent.
Expected value
The expected value of a standard Student's t random variable is welldefined only for and it is equal to
Proof
It follows from the fact that the density function is symmetric around :The above integrals are finite (and so the expected value is welldefined) only if becauseand the above limit is finite only if .
Variance
The variance of a standard Student's t random variable is welldefined only for and it is equal to
Proof
It can be derived thanks to the usual variance formula () and to the integral representation of the Beta function:From the above derivation, it should be clear that the variance is welldefined only when . Otherwise, if , the above improper integrals do not converge (and the Beta function is not welldefined).
Higher moments
The th moment of a standard Student's t random variable is welldefined only for and it is equal to
Proof
By using the definition of moment, we getTherefore, to compute the th moment and to verify whether it exists and is finite, we need to study the following integral:From the above derivation, it should be clear that the th moment is welldefined only when . Otherwise, if , the above improper integrals do not converge (the integrals involve the Beta function, which is welldefined and converges only when its arguments are strictly positive  in this case only if ). Therefore, the th moment of is
Moment generating function
A standard Student's t random variable does not possess a moment generating function.
Proof
When a random variable possesses a moment generating function, then the th moment of exists and is finite for any . But we have proved above that the th moment of exists only for . Therefore, can not have a moment generating function.
Characteristic function
There is no simple expression for the characteristic function of the standard Student's t distribution. It can be expressed in terms of a Modified Bessel function of the second kind (a solution of a certain differential equation, called modified Bessel's differential equation).
The interested reader can consult Sutradhar (1986).
Distribution function
There is no simple formula for the distribution function of a standard Student's t random variable because the integralcannot be expressed in terms of elementary functions.
Therefore, it is usually necessary to resort to computer algorithms to compute the values of .
For example, the MATLAB command:returns the value of the distribution function at the point x
when the degrees of freedom parameter is equal to n
.
Student's t distribution in general
While in the previous section we restricted our attention to the Student's t distribution with zero mean and unit scale, we now deal with the general case.
Definition
The Student's t distribution is characterized as follows.
Definition Let be a continuous random variable. Let its support be the whole set of real numbers:Let , and . We say that has a Student's t distribution with mean , scale and degrees of freedom if and only if its probability density function iswhere is a constant:and is the Beta function.
We indicate that has a t distribution with mean , scale parameter and degrees of freedom by
To better understand the Student's t distribution, you can have a look at its density plots.
Relation between standard and general
A random variable has a t distribution with parameters , and if it is a linear transformation of a standard Student's t random variable.
Proposition If , thenwhere is a random variable having a standard t distribution.
Proof
Since is strictly positive, is a strictly increasing function of . Therefore, we can use the formula for the density of a function of a continuous variable:
Expected value
The expected value of a Student's t random variable is welldefined only for and it is equal to
Proof
It is an immediate consequence of the fact that (where has a standard t distribution) and the linearity of the expected value:As we have seen above, is welldefined only for and, as a consequence, also is welldefined only for .
Variance
The variance of a Student's t random variable is welldefined only for and it is equal to
Proof
It can be derived using the formula for the variance of affine transformations on (where has a standard t distribution):As we have seen above, is welldefined only for and, as a consequence, also is welldefined only for .
Moment generating function
A Student's t random variable does not possess a moment generating function.
Proof
It is a consequence of the fact that (where has a standard t distribution) and of the fact that a standard Student's t random variable does not possess a moment generating function (see above).
Characteristic function
There is no simple expression for the characteristic function of the Student's t distribution (see the comments above, for the standard case).
Distribution function
As in the case of the standard t distribution (see above), there is no simple formula for the distribution function of a Student's t random variable .
As a consequence, it is usually necessary to resort to computer algorithms to compute the values of .
Most computer programs provide only routines for the computation of the standard t distribution function (denote it by ).
In these cases we need to make a conversion, as follows:For example, the MATLAB command:returns the value at the point x
of the distribution function of a Student's t random variable with mean mu
, scale sigma
and n
degrees of freedom.
More details
The following sections contain more details about the t distribution.
Convergence to the normal distribution
A Student's t distribution with mean , scale parameter and degrees of freedom converges in distribution to a normal distribution with mean and variance when the number of degrees of freedom becomes large (converges to infinity).
Proof
As explained before, if has a t distribution, it can be written aswhere is a standard normal random variable, and is a Chisquare random variable with degrees of freedom, independent of . Moreover, as explained in the lecture on the Chisquare distribution, can be written as a sum of squares of independent standard normal random variables :When tends to infinity, the ratioconverges in probability to , by the Law of Large Numbers. As a consequence, by slu*tsky's theorem, converges in distribution to which is a normal random variable with mean and variance .
Noncentral t distribution
As discussed above, if has a standard normal distribution, has a Gamma distribution with parameters and and and are independent, then the random variable defined ashas a standard Student's t distribution with degrees of freedom.
Given the same assumptions on and , define a random variable as follows:where is a constant.
The variable is said to have a noncentral standard Student's t distribution with degrees of freedom and noncentrality parameter .
We do not discuss the details of this distribution here, but be aware that this distribution is sometimes used in statistical theory (also in elementary problems) and that routines to compute its moments and its distribution function can be found in most statistical software packages.
Density plots
This section shows the plots of the densities of some random variables having a t distribution.
The plots help us to understand how the shape of the t distribution changes by changing its parameters.
Plot 1 Changing the mean
The following plot shows two Student's t probability density functions:

the blue line is the pdf of a Student's t random variable with parameters , and ;

the orange line is obtained by changing the parameters to , and .
By changing only the mean, the shape of the density does not change, but the density is translated to the right (its location changes).
Plot 2  Changing the scale
In the following plot:

the blue line is the pdf of a Student's t random variable with parameters , and ;

the orange line is obtained by changing the parameters to , and .
By changing only the scale parameter, from to , the location of the graph does not change (it remains centered at ), but the shape of the graph changes (there is less density in the center and more density in the tails).
Plot 3  Changing the degrees of freedom
In the following plot:

the blue line is the pdf of a Student's t random variable with parameters , and ;

the orange line is obtained by changing the parameters to , and .
By changing only the number of degrees of freedom, from to , the location of the graph does not change (it remains centered at ) and its shape changes only marginally (the tails become thinner).
Solved exercises
Below you can find some exercises with explained solutions.
Exercise 1
Let be a normal random variable with mean and variance .
Let be a Gamma random variable with parameters and , independent of .
Find the distribution of the ratio
Solution
We can writewhere has a standard normal distribution and has a Gamma distribution with parameters and . Therefore, the ratiohas a standard Student's t distribution with degrees of freedom and has a Student's t distribution with mean , scale and degrees of freedom.
Exercise 2
Let be a normal random variable with mean and variance .
Let be a Gamma random variable with parameters and , independent of .
Find the distribution of the random variable
Solution
We can writewhere has a standard normal distribution and has a Gamma distribution with parameters and . Therefore, the ratiohas a standard Stutent's t distribution with degrees of freedom.
Exercise 3
Let be a Student's t random variable with mean , scale and degrees of freedom.
Compute
Solution
First of all, we need to write the probability in terms of the distribution function of :Then, we express the distribution function of in terms of the distribution function of a standard Student's t random variable with degrees of freedom:so that:where the difference can be computed with a computer algorithm, for example using the MATLAB command
tcdf(0,6)tcdf(1/2,6)
References
Sutradhar, B. C. (1986) On the characteristic function of multivariate Student tdistribution, Canadian Journal of Statistics, 14, 329337.
How to cite
Please cite as:
Taboga, Marco (2021). "Student's t distribution", Lectures on probability theory and mathematical statistics. Kindle Direct Publishing. Online appendix. https://www.statlect.com/probabilitydistributions/studenttdistribution.