Student's t-distribution


In probability and statistics, Student's t-distribution is any member of a family of continuous probability distributions that arises when estimating the mean of a normally distributed population in situations where the sample size is small and the population standard deviation is unknown. It was developed by William Sealy Gosset under the pseudonym Student.
The t-distribution plays a role in a number of widely used statistical analyses, including Student's t-test for assessing the statistical significance of the difference between two sample means, the construction of confidence intervals for the difference between two population means, and in linear regression analysis. The Student's t-distribution also arises in the Bayesian analysis of data from a normal family.
If we take a sample of observations from a normal distribution, then the t-distribution with degrees of freedom can be defined as the distribution of the location of the sample mean relative to the true mean, divided by the sample standard deviation, after multiplying by the standardizing term. In this way, the t-distribution can be used to construct a confidence interval for the true mean.
The t-distribution is symmetric and bell-shaped, like the normal distribution, but has heavier tails, meaning that it is more prone to producing values that fall far from its mean. This makes it useful for understanding the statistical behavior of certain types of ratios of random quantities, in which variation in the denominator is amplified and may produce outlying values when the denominator of the ratio falls close to zero. The Student's t-distribution is a special case of the generalised hyperbolic distribution.

History and etymology

In statistics, the t-distribution was first derived as a posterior distribution in 1876 by Helmert and Lüroth. The t-distribution also appeared in a more general form as Pearson Type IV distribution in Karl Pearson's 1895 paper.
In the English-language literature the distribution takes its name from William Sealy Gosset's 1908 paper in Biometrika under the pseudonym "Student". Gosset worked at the Guinness Brewery in Dublin, Ireland, and was interested in the problems of small samples – for example, the chemical properties of barley where sample sizes might be as few as 3. One version of the origin of the pseudonym is that Gosset's employer preferred staff to use pen names when publishing scientific papers instead of their real name, so he used the name "Student" to hide his identity. Another version is that Guinness did not want their competitors to know that they were using the t-test to determine the quality of raw material.
Gosset's paper refers to the distribution as the "frequency distribution of standard deviations of samples drawn from a normal population". It became well known through the work of Ronald Fisher, who called the distribution "Student's distribution" and represented the test value with the letter t.

How Student's distribution arises from sampling

Let be independently and identically drawn from the distribution, i.e. this is a sample of size from a normally distributed population with expected mean value and variance.
Let
be the sample mean and let
be the sample variance. Then the random variable
has a standard normal distribution, and the random variable
where has been substituted for, has a Student's t-distribution with degrees of freedom. The numerator and the denominator in the preceding expression are independent random variables despite being based on the same sample.

Definition

Probability density function

Student's t-distribution has the probability density function given by
where is the number of degrees of freedom and is the gamma function. This may also be written as
where B is the Beta function. In particular for integer valued degrees of freedom we have:
For even,
For odd,
The probability density function is symmetric, and its overall shape resembles the bell shape of a normally distributed variable with mean 0 and variance 1, except that it is a bit lower and wider. As the number of degrees of freedom grows, the t-distribution approaches the normal distribution with mean 0 and variance 1. For this reason is also known as the normality parameter.
The following images show the density of the t-distribution for increasing values of. The normal distribution is shown as a blue line for comparison. Note that the t-distribution becomes closer to the normal distribution as increases.

Cumulative distribution function

The cumulative distribution function can be written in terms of I, the regularized
incomplete beta function. For t > 0,
where
Other values would be obtained by symmetry. An alternative formula, valid for, is
where 2F1 is a particular case of the hypergeometric function.
For information on its inverse cumulative distribution function, see.

Special cases

Certain values of give an especially simple form.

How the ''t''-distribution arises

Sampling distribution

Let be the numbers observed in a sample from a continuously distributed population with expected value. The sample mean and sample variance are given by:
The resulting t-value is
The t-distribution with degrees of freedom is the sampling distribution of the t-value when the samples consist of independent identically distributed observations from a normally distributed population. Thus for inference purposes t is a useful "pivotal quantity" in the case when the mean and variance are unknown population parameters, in the sense that the t-value has then a probability distribution that depends on neither nor.

Bayesian inference

In Bayesian statistics, a t-distribution arises as the marginal distribution of the unknown mean of a normal distribution, when the dependence on an unknown variance has been marginalized out:
where stands for the data, and represents any other information that may have been used to create the model. The distribution is thus the compounding of the conditional distribution of given the data and with the marginal distribution of given the data.
With data points, if uninformative, or flat, location and scale priors and can be taken for μ and σ2, then Bayes' theorem gives
a normal distribution and a scaled inverse chi-squared distribution respectively, where and
The marginalization integral thus becomes
This can be evaluated by substituting, where, giving
so
But the z integral is now a standard Gamma integral, which evaluates to a constant, leaving
This is a form of the t-distribution with an explicit scaling and shifting that will be explored in more detail in a further section below. It can be related to the standardized t-distribution by the substitution
The derivation above has been presented for the case of uninformative priors for and ; but it will be apparent that any priors that lead to a normal distribution being compounded with a scaled inverse chi-squared distribution will lead to a t-distribution with scaling and shifting for, although the scaling parameter corresponding to above will then be influenced both by the prior information and the data, rather than just by the data as above.

Characterization

As the distribution of a test statistic

Student's t-distribution with degrees of freedom can be defined as the distribution of the random variable T with
where
A different distribution is defined as that of the random variable defined, for a given constant μ, by
This random variable has a noncentral t-distribution with noncentrality parameter μ. This distribution is important in studies of the power of Student's t-test.

Derivation

Suppose X1,..., Xn are independent realizations of the normally-distributed, random variable X, which has an expected value μ and variance σ2. Let
be the sample mean, and
be an unbiased estimate of the variance from the sample. It can be shown that the random variable
has a chi-squared distribution with degrees of freedom. It is readily shown that the quantity
is normally distributed with mean 0 and variance 1, since the sample mean is normally distributed with mean μ and variance σ2/n. Moreover, it is possible to show that these two random variables are independent. Consequently the pivotal quantity
which differs from Z in that the exact standard deviation σ is replaced by the random variable Sn, has a Student's t-distribution as defined above. Notice that the unknown population variance σ2 does not appear in T, since it was in both the numerator and the denominator, so it canceled. Gosset intuitively obtained the probability density function stated above, with equal to n − 1, and Fisher proved it in 1925.
The distribution of the test statistic T depends on, but not μ or σ; the lack of dependence on μ and σ is what makes the t-distribution important in both theory and practice.

As a maximum entropy distribution

Student's t-distribution is the maximum entropy probability distribution for a random variate X for which is fixed.

Properties

Moments

For, the raw moments of the t-distribution are
Moments of order or higher do not exist.
The term for, k even, may be simplified using the properties of the gamma function to
For a t-distribution with degrees of freedom, the expected value is 0 if, and its variance is if. The skewness is 0 if and the excess kurtosis is if.

Monte Carlo sampling

There are various approaches to constructing random samples from the Student's t-distribution. The matter depends on whether the samples are required on a stand-alone basis, or are to be constructed by application of a quantile function to uniform samples; e.g., in the multi-dimensional applications basis of copula-dependency. In the case of stand-alone sampling, an extension of the Box–Muller method and its polar form is easily deployed. It has the merit that it applies equally well to all real positive degrees of freedom, ν, while many other candidate methods fail if ν is close to zero.

Integral of Student's probability density function and ''p''-value

The function A is the integral of Student's probability density function, f between −t and t, for t ≥ 0. It thus gives the probability that a value of t less than that calculated from observed data would occur by chance. Therefore, the function A can be used when testing whether the difference between the means of two sets of data is statistically significant, by calculating the corresponding value of t and the probability of its occurrence if the two sets of data were drawn from the same population. This is used in a variety of situations, particularly in t-tests. For the statistic t, with ν degrees of freedom, A is the probability that t would be less than the observed value if the two means were the same. It can be easily calculated from the cumulative distribution function Fν of the t-distribution:
where Ix is the regularized incomplete beta function.
For statistical hypothesis testing this function is used to construct the p-value.

Generalized Student's ''t''-distribution

In terms of scaling parameter \hat{\sigma} or \hat{\sigma}^2

Student's t distribution can be generalized to a three parameter location-scale family, introducing a location parameter and a scale parameter, through the relation
or
This means that has a classic Student's t distribution with degrees of freedom.
The resulting non-standardized Student's t-distribution has a density defined by:
Here, does not correspond to a standard deviation: it is not the standard deviation of the scaled t distribution, which may not even exist; nor is it the standard deviation of the underlying normal distribution, which is unknown. simply sets the overall scaling of the distribution. In the Bayesian derivation of the marginal distribution of an unknown normal mean above, as used here corresponds to the quantity, where
Equivalently, the distribution can be written in terms of, the square of this scale parameter:
Other properties of this version of the distribution are:
This distribution results from compounding a Gaussian distribution with mean and unknown variance, with an inverse gamma distribution placed over the variance with parameters and. In other words, the random variable X is assumed to have a Gaussian distribution with an unknown variance distributed as inverse gamma, and then the variance is marginalized out. The reason for the usefulness of this characterization is that the inverse gamma distribution is the conjugate prior distribution of the variance of a Gaussian distribution. As a result, the non-standardized Student's t-distribution arises naturally in many Bayesian inference problems. See below.
Equivalently, this distribution results from compounding a Gaussian distribution with a scaled-inverse-chi-squared distribution with parameters and. The scaled-inverse-chi-squared distribution is exactly the same distribution as the inverse gamma distribution, but with a different parameterization, i.e..

In terms of inverse scaling parameter ''λ''

An alternative parameterization in terms of an inverse scaling parameter , defined by the relation. The density is then given by:
Other properties of this version of the distribution are:
This distribution results from compounding a Gaussian distribution with mean and unknown precision, with a gamma distribution placed over the precision with parameters and. In other words, the random variable X is assumed to have a normal distribution with an unknown precision distributed as gamma, and then this is marginalized over the gamma distribution.

Related distributions

In frequentist statistical inference

Student's t-distribution arises in a variety of statistical estimation problems where the goal is to estimate an unknown parameter, such as a mean value, in a setting where the data are observed with additive errors. If the population standard deviation of these errors is unknown and has to be estimated from the data, the t-distribution is often used to account for the extra uncertainty that results from this estimation. In most such problems, if the standard deviation of the errors were known, a normal distribution would be used instead of the t-distribution.
Confidence intervals and hypothesis tests are two statistical procedures in which the quantiles of the sampling distribution of a particular statistic are required. In any situation where this statistic is a linear function of the data, divided by the usual estimate of the standard deviation, the resulting quantity can be rescaled and centered to follow Student's t-distribution. Statistical analyses involving means, weighted means, and regression coefficients all lead to statistics having this form.
Quite often, textbook problems will treat the population standard deviation as if it were known and thereby avoid the need to use the Student's t-distribution. These problems are generally of two kinds: those in which the sample size is so large that one may treat a data-based estimate of the variance as if it were certain, and those that illustrate mathematical reasoning, in which the problem of estimating the standard deviation is temporarily ignored because that is not the point that the author or instructor is then explaining.

Hypothesis testing

A number of statistics can be shown to have t-distributions for samples of moderate size under null hypotheses that are of interest, so that the t-distribution forms the basis for significance tests. For example, the distribution of Spearman's rank correlation coefficient ρ, in the null case is well approximated by the t distribution for sample sizes above about 20.

Confidence intervals

Suppose the number A is so chosen that
when T has a t-distribution with n − 1 degrees of freedom. By symmetry, this is the same as saying that A satisfies
so A is the "95th percentile" of this probability distribution, or. Then
and this is equivalent to
Therefore, the interval whose endpoints are
is a 90% confidence interval for μ. Therefore, if we find the mean of a set of observations that we can reasonably expect to have a normal distribution, we can use the t-distribution to examine whether the confidence limits on that mean include some theoretically predicted value – such as the value predicted on a null hypothesis.
It is this result that is used in the Student's t-tests: since the difference between the means of samples from two normal distributions is itself distributed normally, the t-distribution can be used to examine whether that difference can reasonably be supposed to be zero.
If the data are normally distributed, the one-sided -upper confidence limit of the mean, can be calculated using the following equation:
The resulting UCL will be the greatest average value that will occur for a given confidence interval and population size. In other words, being the mean of the set of observations, the probability that the mean of the distribution is inferior to UCL1−α is equal to the confidence level 1 − α.

Prediction intervals

The t-distribution can be used to construct a prediction interval for an unobserved sample from a normal distribution with unknown mean and variance.

In Bayesian statistics

The Student's t-distribution, especially in its three-parameter version, arises frequently in Bayesian statistics as a result of its connection with the normal distribution. Whenever the variance of a normally distributed random variable is unknown and a conjugate prior placed over it that follows an inverse gamma distribution, the resulting marginal distribution of the variable will follow a Student's t-distribution. Equivalent constructions with the same results involve a conjugate scaled-inverse-chi-squared distribution over the variance, or a conjugate gamma distribution over the precision. If an improper prior proportional to σ−2 is placed over the variance, the t-distribution also arises. This is the case regardless of whether the mean of the normally distributed variable is known, is unknown distributed according to a conjugate normally distributed prior, or is unknown distributed according to an improper constant prior.
Related situations that also produce a t-distribution are:
The t-distribution is often used as an alternative to the normal distribution as a model for data, which often has heavier tails than the normal distribution allows for; see e.g. Lange et al. The classical approach was to identify outliers and exclude or downweight them in some way. However, it is not always easy to identify outliers, and the t-distribution is a natural choice of model for such data and provides a parametric approach to robust statistics.
A Bayesian account can be found in Gelman et al. The degrees of freedom parameter controls the kurtosis of the distribution and is correlated with the scale parameter. The likelihood can have multiple local maxima and, as such, it is often necessary to fix the degrees of freedom at a fairly low value and estimate the other parameters taking this as given. Some authors report that values between 3 and 9 are often good choices. Venables and Ripley suggest that a value of 5 is often a good choice.

Student's t-process

For practical regression and prediction needs, Student's t-processes were introduced, that are generalisations of the Student t-distributions for functions. A Student's t-process is constructed from the Student t-distributions like a Gaussian process is constructed from the Gaussian distributions. For a Gaussian process, all sets of values have a multidimensional Gaussian distribution. Analogiusly, is a Student t-process on an interval if the correspondent values of the process have a joint multivariate Student t-distribution. These processes are used for regression, prediction, Bayesian optimization and related problems. For multivariate regression and multi-output prediction, the matrix-values Student's t-processes are introduced and used.

Table of selected values

The following table lists values for t-distributions with ν degrees of freedom for a range of one-sided or two-sided critical regions. The first column is ν, the percentages along the top are confidence levels, and the numbers in the body of the table are the factors described in the section on confidence intervals.
Note that the last row with infinite ν gives critical points for a normal distribution since a t-distribution with infinitely many degrees of freedom is a normal distribution..
One-sided75%80%85%90%95%97.5%99%99.5%99.75%99.9%99.95%
Two-sided50%60%70%80%90%95%98%99%99.5%99.8%99.9%
11.0001.3761.9633.0786.31412.7131.8263.66127.3318.3636.6
20.8161.0801.3861.8862.9204.3036.9659.92514.0922.3331.60
30.7650.9781.2501.6382.3533.1824.5415.8417.45310.2112.92
40.7410.9411.1901.5332.1322.7763.7474.6045.5987.1738.610
50.7270.9201.1561.4762.0152.5713.3654.0324.7735.8936.869
60.7180.9061.1341.4401.9432.4473.1433.7074.3175.2085.959
70.7110.8961.1191.4151.8952.3652.9983.4994.0294.7855.408
80.7060.8891.1081.3971.8602.3062.8963.3553.8334.5015.041
90.7030.8831.1001.3831.8332.2622.8213.2503.6904.2974.781
100.7000.8791.0931.3721.8122.2282.7643.1693.5814.1444.587
110.6970.8761.0881.3631.7962.2012.7183.1063.4974.0254.437
120.6950.8731.0831.3561.7822.1792.6813.0553.4283.9304.318
130.6940.8701.0791.3501.7712.1602.6503.0123.3723.8524.221
140.6920.8681.0761.3451.7612.1452.6242.9773.3263.7874.140
150.6910.8661.0741.3411.7532.1312.6022.9473.2863.7334.073
160.6900.8651.0711.3371.7462.1202.5832.9213.2523.6864.015
170.6890.8631.0691.3331.7402.1102.5672.8983.2223.6463.965
180.6880.8621.0671.3301.7342.1012.5522.8783.1973.6103.922
190.6880.8611.0661.3281.7292.0932.5392.8613.1743.5793.883
200.6870.8601.0641.3251.7252.0862.5282.8453.1533.5523.850
210.6860.8591.0631.3231.7212.0802.5182.8313.1353.5273.819
220.6860.8581.0611.3211.7172.0742.5082.8193.1193.5053.792
230.6850.8581.0601.3191.7142.0692.5002.8073.1043.4853.767
240.6850.8571.0591.3181.7112.0642.4922.7973.0913.4673.745
250.6840.8561.0581.3161.7082.0602.4852.7873.0783.4503.725
260.6840.8561.0581.3151.7062.0562.4792.7793.0673.4353.707
270.6840.8551.0571.3141.7032.0522.4732.7713.0573.4213.690
280.6830.8551.0561.3131.7012.0482.4672.7633.0473.4083.674
290.6830.8541.0551.3111.6992.0452.4622.7563.0383.3963.659
300.6830.8541.0551.3101.6972.0422.4572.7503.0303.3853.646
400.6810.8511.0501.3031.6842.0212.4232.7042.9713.3073.551
500.6790.8491.0471.2991.6762.0092.4032.6782.9373.2613.496
600.6790.8481.0451.2961.6712.0002.3902.6602.9153.2323.460
800.6780.8461.0431.2921.6641.9902.3742.6392.8873.1953.416
1000.6770.8451.0421.2901.6601.9842.3642.6262.8713.1743.390
1200.6770.8451.0411.2891.6581.9802.3582.6172.8603.1603.373
0.6740.8421.0361.2821.6451.9602.3262.5762.8073.0903.291
One-sided75%80%85%90%95%97.5%99%99.5%99.75%99.9%99.95%
Two-sided50%60%70%80%90%95%98%99%99.5%99.8%99.9%

Calculating the confidence interval
Let's say we have a sample with size 11, sample mean 10, and sample variance 2. For 90% confidence with 10 degrees of freedom, the one-sided t-value from the table is 1.372. Then with confidence interval calculated from
we determine that with 90% confidence we have a true mean lying below
In other words, 90% of the times that an upper threshold is calculated by this method from particular samples, this upper threshold exceeds the true mean.
And with 90% confidence we have a true mean lying above
In other words, 90% of the times that a lower threshold is calculated by this method from particular samples, this lower threshold lies below the true mean.
So that at 80% confidence, we have a true mean lying within the interval
Saying that 80% of the times that upper and lower thresholds are calculated by this method from a given sample, the true mean is both below the upper threshold and above the lower threshold is not the same as saying that there is an 80% probability that the true mean lies between a particular pair of upper and lower thresholds that have been calculated by this method; see confidence interval and prosecutor's fallacy.
Nowadays, statistical software, such as the R programming language, and functions available in many spreadsheet programs compute values of the t-distribution and its inverse without tables.