Chi-Squared Distribution

March 29, 2018

Chi-squared (\chi^2) distribution is the distribution of a sum of squared random variables. Among other applications, it can be used to estimate the confidence interval for the variance of a random variable from a normal distribution.

A chi-squared distribution with N degrees of freedom (\chi^2_{N}) determines the probability of a normal distribution where the mean value (\mu) equals 0 and variance (\sigma^2) equals 1.

Figure 3.15 provides examples of the \chi^2_{N} probability density function (PDF) for different values of N. As N approaches infinity, the \chi^2_{N} distribution converges with the normal distribution. For all the \chi^2_{N} distributions, the mean value is \mu = N and the variance is \sigma^2 = 2.

The formula for the PDF is as follows (Equation 16), where Γ is the Gamma function.

(1)   \begin{equation*} \chi^2_{N} = \frac {x^{(\frac{N}{2} - 1)}e^{-\frac {x}{2}}} {2^\frac{N}{2} \Gamma (\frac{N}{2})} \end{equation*}

Equation 16

chisquared-figure15

Figure 3.14. \chi^2_{N} distribution for the sum of N values of x2.

The squared values used to evaluate the mean-square are \chi^2_{1} distributed. This is illustrated in Figure 3.15 using the car vibration signal shown in Figure 3.2. The distribution is strongly biased toward small values as shown by the simplified formula for \chi^2_{1}:

(2)   \begin{equation*} \chi^2_{1} = \frac {1}{\sqrt{2\pi x}}e^{-\frac{x}{2}} \end{equation*}

Equation 17

chisquared-figure16

Figure 3.15. PDF of squared car vibration data from Figure 3.2 compared to \chi^2_{1}.

As variance is derived from the mean-square value, the confidence interval for the variance can be determined using the \chi^2_{N} distribution.

For a random variable x with a standard deviation of σx, the summation of N values-squared has a σx2χ12 distribution. Therefore, the variance has a σx2χ12/N distribution.

As the \chi^2_{N} distributions are not symmetrical, the estimated confidence intervals for the variance are not symmetrical. In Figure 3.16, the values of N / \chi^2_{N} are plotted versus N for different confidence levels. The confidence interval for the variance is then stated as the interval:

(3)   \begin{equation*} \left(\frac {N\sigma^2_{x}}{\chi^2_{lower}}, \frac {N\sigma^2_{x}}{\chi^2_{upper}}\right), \text {with the appropriate e confidence level} \end{equation*}

chisquared-figure17

Figure 3.16. Confidence intervals using the \chi^2_{N} distribution for small sample sizes.

For N > 100, normal distribution can be used. The standard deviation of the variance estimate is √2/N σxand the (symmetrical) confidence intervals from Figure 3.13 can be used.