StatlectThe Digital Textbook
Index > Probability distributions

Chi-square distribution

A random variable X has a Chi-square distribution if it can be written as a sum of squares:[eq1]where $Y_{1}$, ..., $Y_{n}$ are mutually independent standard normal random variables. The importance of the Chi-square distribution stems from the fact that sums of this kind are encountered very often in statistics, especially in the estimation of variance and in hypothesis testing.

Definition

Chi-square random variables are characterized as follows.

Definition Let X be an absolutely continuous random variable. Let its support be the set of positive real numbers:[eq2]Let $nin U{2115} $. We say that X has a Chi-square distribution with n degrees of freedom if its probability density function is[eq3]where $c$ is a constant:[eq4]and [eq5] is the Gamma function.

The following notation is often employed to indicate that a random variable X has a Chi-square distribution with n degrees of freedom:[eq6]where the symbol $symbol{126}$ means "is distributed as".

To better understand the Chi-square distribution, you can have a look at its density plots.

Expected value

The expected value of a Chi-square random variable X is[eq7]

Proof

It can be derived as follows:[eq8]

Variance

The variance of a Chi-square random variable X is[eq9]

Proof

It can be derived thanks to the usual variance formula ([eq10]):[eq11]

Moment generating function

The moment generating function of a Chi-square random variable X is defined for any $frac{1}{2}$:[eq12]

Proof

Using the definition of moment generating function, we obtain:[eq13]The integral above is well-defined and finite only when $frac{1}{2}-t>0$, i.e., when $frac{1}{2}$. Thus, the moment generating function of a Chi-square random variable exists for any $frac{1}{2}$.

Characteristic function

The characteristic function of a Chi-square random variable X is[eq14]

Proof

Using the definition of characteristic function, we obtain:[eq15]

Distribution function

The distribution function of a Chi-square random variable is[eq16]where the function[eq17]is called lower incomplete Gamma function and is usually computed by means of specialized computer algorithms.

Proof

This is proved as follows:[eq18]

Usually, it is possible to resort to computer algorithms that directly compute the values of [eq19]. For example, the MATLAB command

chi2cdf(x,n)

returns the value at the point x of the distribution function of a Chi-square random variable with n degrees of freedom.

In the past, when computers were not widely available, people used to look up the values of [eq20] in Chi-square distribution tables, where [eq21] is tabulated for several values of x and n (see the lecture entitled Chi-square distribution values).

More details

In the following subsections you can find more details about the Chi-square distribution.

The sum of independent chi-square random variables is a Chi-square random variable

Let X_1 be a Chi-square random variable with $n_{1}$ degrees of freedom and X_2 another Chi-square random variable with $n_{2}$ degrees of freedom. If X_1 and X_2 are independent, then their sum has a Chi-square distribution with $n_{1}+n_{2}$ degrees of freedom:[eq22]This can be generalized to sums of more than two Chi-square random variables, provided they are mutually independent:[eq23]

Proof

This can be easily proved using moment generating functions. The moment generating function of X_i is[eq24]Define[eq25]The moment generating function of a sum of mutually independent random variables is just the product of their moment generating functions:[eq26]where [eq27]Therefore, the moment generating function of X is the moment generating function of a Chi-square random variable with n degrees of freedom, and, as a consequence, X is a Chi-square random variable with n degrees of freedom.

The square of a standard normal random variable is a Chi-square random variable

Let Z be a standard normal random variable and let X be its square:[eq28]Then X is a Chi-square random variable with 1 degree of freedom.

Proof

For $xgeq 0$, the distribution function of X is[eq29]where [eq30] is the probability density function of a standard normal random variable:[eq31]For $x<0$, [eq32] because X, being a square, cannot be negative. Using Leibniz integral rule and the fact that the density function is the derivative of the distribution function, the probability density function of X, denoted by [eq33], is obtained as follows (for $xgeq 0$):[eq34]For $x<0$, trivially, [eq35]. As a consequence,[eq36]Therefore, [eq37] is the probability density function of a Chi-square random variable with 1 degree of freedom.

The sum of squares of independent standard normal random variables is a Chi-square random variable

Combining the two facts above, one trivially obtains that the sum of squares of n independent standard normal random variables is a Chi-square random variable with n degrees of freedom.

Solved exercises

Below you can find some exercises with explained solutions:

  1. Exercise set 1 (perform calculations involving the Chi-square distribution)

The book

Most learning materials found on this website are now available in a traditional textbook format.