Chi-squared distribution

[7] The chi-squared distribution is used in the common chi-squared tests for goodness of fit of an observed distribution to a theoretical one, the independence of two criteria of classification of qualitative data, and in finding the confidence interval for estimating the population standard deviation of a normal distribution from a sample standard deviation.

Many other statistical tests also use this distribution, such as Friedman's analysis of variance by ranks.

For these hypothesis tests, as the sample size, n, increases, the sampling distribution of the test statistic approaches the normal distribution (central limit theorem).

Testing hypotheses using a normal distribution is well understood and relatively easy.

is a random variable sampled from the standard normal distribution, where the mean is

Just as extreme values of the normal distribution have low probability (and give small p-values), extreme values of the chi-squared distribution have low probability.

Similarly, in analyses of contingency tables, the chi-squared approximation will be poor for a small sample size, and it is preferable to use Fisher's exact test.

Ramsey shows that the exact binomial test is always more powerful than the normal approximation.

[9] Lancaster shows the connections among the binomial, normal, and chi-squared distributions, as follows.

However, many problems involve more than the two possible outcomes of a binomial, and instead require 3 or more categories, which leads to the multinomial distribution.

Just as de Moivre and Laplace sought for and found the normal approximation to the binomial, Pearson sought for and found a degenerate multivariate normal approximation to the multinomial distribution (the numbers in each category add up to the total sample size, which is considered fixed).

Pearson showed that the chi-squared distribution arose from such a multivariate normal approximation to the multinomial distribution, taking careful account of the statistical dependence (negative correlations) between numbers of observations in different categories.

The integer recurrence of the gamma function makes it easy to compute

, Chernoff bounds on the lower and upper tails of the CDF may be obtained.

, similarly, is For another approximation for the CDF modeled after the cube of a Gaussian, see under Noncentral chi-squared distribution.

independent random variables with finite mean and variance, it converges to a normal distribution for large

The sum of squares of statistically independent unit-variance Gaussian variables which do not have mean zero yields a generalization of the chi-squared distribution called the noncentral chi-squared distribution.

positive-semidefinite covariance matrix with strictly positive diagonal entries, then for

In particular, The chi-squared distribution is obtained as the sum of the squares of k independent, zero-mean, unit-variance Gaussian random variables.

Generalizations of this distribution can be obtained by summing the squares of other types of Gaussian random variables.

It may be, however, approximated efficiently using the property of characteristic functions of chi-square random variables.

[21] The noncentral chi-squared distribution is obtained from the sum of the squares of independent Gaussian random variables having unit variance and nonzero means.

The generalized chi-squared distribution is obtained from the quadratic form z'Az where z is a zero-mean Gaussian vector having an arbitrary covariance matrix, and A is an arbitrary matrix.

It enters all analysis of variance problems via its role in the F-distribution, which is the distribution of the ratio of two independent chi-squared random variables, each divided by their respective degrees of freedom.

Following are some of the most common situations in which the chi-squared distribution arises from a Gaussian-distributed sample.

-value is the probability of observing a test statistic at least as extreme in a chi-squared distribution.

Accordingly, since the cumulative distribution function (CDF) for the appropriate degrees of freedom (df) gives the probability of having obtained a value less extreme than this point, subtracting the CDF value from 1 gives the p-value.

These values can be calculated evaluating the quantile function (also known as "inverse CDF" or "ICDF") of the chi-squared distribution;[24] e. g., the χ2 ICDF for p = 0.05 and df = 7 yields 2.1673 ≈ 2.17 as in the table above, noticing that 1 – p is the p-value from the table.

This distribution was first described by the German geodesist and statistician Friedrich Robert Helmert in papers of 1875–6,[25][26] where he computed the sampling distribution of the sample variance of a normal population.

The name "chi-square" ultimately derives from Pearson's shorthand for the exponent in a multivariate normal distribution with the Greek letter Chi, writing −½χ2 for what would appear in modern notation as −½xTΣ−1x (Σ being the covariance matrix).

Chernoff bound for the CDF and tail (1-CDF) of a chi-squared random variable with ten degrees of freedom ( )
Approximate formula for median (from the Wilson–Hilferty transformation) compared with numerical quantile (top); and difference ( blue ) and relative difference ( red ) between numerical quantile and approximate formula (bottom). For the chi-squared distribution, only the positive integer numbers of degrees of freedom (circles) are meaningful.