What Is the Chi-Squared Distribution?
A chi-squared distribution can be constructed by taking some independent standard normal random variables, squaring them, and adding them together.
It is also commonly called the chi-square distribution.
The “building blocks” we need to start with are a series of independent copies of $Z$:
$$Z_1,\ldots,Z_n \ \overset{\mathrm{iid}}{\sim}\mathcal{N}(0,1).$$
Then the random variable
$$X=\sum_{i=1}^n Z_i^2$$
has a chi-squared distribution with $n$ degrees of freedom.
For this construction, the number of degrees of freedom, $n$, simply tells us how many independent standard normal random variables have been squared and added together. We write
$$X\sim\chi_n^2.$$
Example: Three Degrees of Freedom
Suppose we have three independent standard normal random variables:
$$Z_1,Z_2,Z_3\overset{\mathrm{iid}}{\sim}\mathcal{N}(0,1).$$
Construct
$$X=Z_1^2+Z_2^2+Z_3^2.$$
Then
$$X\sim\chi_3^2.$$
To generate a single observation from this distribution, we draw three independent standard normal values, square each one, and add the results.
For example, suppose we happen to draw
$$Z_1=1,\qquad Z_2=-0.5,\qquad Z_3=2.$$
Then the corresponding value of $X$ is
$$X=1^2+(-0.5)^2+2^2=5.25.$$
Repeating this process again and again generates data from the chi-squared distribution with three degrees of freedom.
Key Properties of the Chi-Squared Distribution
If
$$X\sim\chi_n^2,$$
then $X$ has support
$$X\geq0,$$
mean
$$\mathbb{E}(X)=n,$$
and variance
$$\operatorname{Var}(X)=2n.$$
For smaller values of $n$, the distribution is positively skewed, with much of its probability concentrated towards the left and a long right tail.
As $n$ increases, the distribution moves further to the right and becomes less skewed.
The formula for the mean has a particularly simple explanation. For a standard normal random variable $Z$,
$$\mathbb{E}(Z)=0$$
and
$$\operatorname{Var}(Z)=1.$$
Since
$$\operatorname{Var}(Z)=\mathbb{E}(Z^2)-(\mathbb{E}(Z))^2,$$
we have
$$\mathbb{E}(Z^2)=1.$$
A chi-squared random variable with $n$ degrees of freedom adds together $n$ such squared standard normals. Therefore,
$$\mathbb{E}(X)=\mathbb{E}(Z_1^2+\cdots+Z_n^2)=1+\cdots+1=n.$$
Interactive Chi-Squared Distribution
The graph below lets you explore how the chi-squared distribution changes with its degrees of freedom.
Use the slider for $n$ to change the number of degrees of freedom.
You can also choose two values $c$ and $d$. The shaded region shows
$$\mathbb{P}(c\leq X\leq d).$$
Try changing $n$ and notice how the shape and location of the distribution change.
Why Is the Chi-Squared Distribution Non-Negative?
Every term in
$$X=Z_1^2+\cdots+Z_n^2$$
is a squared number.
Each squared value is non-negative, so their sum must also be non-negative:
$$X\geq0.$$
This explains why the chi-squared distribution only has support on the non-negative part of the number line.
It also helps explain its characteristic shape. For smaller values of $n$, values close to zero are quite common, while very large sums of squares are possible but increasingly rare.
Why Is the Chi-Squared Distribution Important?
The chi-squared distribution may initially seem like a rather unusual construction, but it appears naturally throughout statistics and econometrics.
In particular, sums of squared normal random variables arise when we study quantities involving variances, because the definition of variance itself involves squaring. They also appear naturally when studying squared deviations, confidence intervals and hypothesis tests.
In addition, the chi-squared distribution will become one of our building blocks for constructing the Student t-distribution and the F-distribution.
Background:
Understanding Econometrics is completely free to use, and always will be.
If you found the site useful and would like to help me keep adding new material, please consider buying me a coffee! Buy me a coffee ☕