Virtual Laboratories > Special Distributions > 1 2 3 [4] 5 6 7 8 9 10 11 12 13 14 15

4. The Chi-Square Distribution


In this section we will study a distribution that has special importance in statistics. In particular, this distribution will arise in the study of the sample variance when the underlying distribution is normal and in a goodness of fit test.

The Chi-Square Density

For n > 0, the gamma distribution with shape parameter k = n / 2 and scale parameter 2 is called the chi-square distribution with n degree of freedom.

Mathematical Exercise 1. Show that the chi-square distribution with n degrees of freedom has density function

f(x) = xn/2 - 1exp(-x / 2) / [2n/2 gam(n / 2)] for x > 0.

Simulation Exercise 2. In the random variable experiment, select the chi-square distribution. Vary n with the scroll bar and note the shape of the density function. With n = 5, run the simulation 1000 times with an update frequency of 10 and note the apparent convergence of the empirical density function to the true density function.

Mathematical Exercise 3. Show that the chi-square distribution with 2 degrees of freedom is the exponential distribution with scale parameter 2.

Mathematical Exercise 4. Draw a careful sketch of the chi-square density functions in each of the following cases:

  1. 0 < n < 2.
  2. n = 2 (the exponential distribution).
  3. n > 2. Show that the mode occurs at n - 2.

The distribution function and the quantile function do not have simple, closed-form representations. Approximate values of these functions can be obtained from the table of the chi-square distribution and from the quantile applet.

Simulation Exercise 5. In the quantile applet, select the chi-square distribution. Vary the parameter and note the shape of the density function and the distribution function. In each of the following cases, find the median, the first and third quartiles, and the interquartile range.

  1. n = 1
  2. n = 2
  3. n = 5
  4. n = 10

Moments

The mean, variance, moments, and moment generating function of the chi-square distribution can be obtained easily from general results for the gamma distribution. In the following exercises, suppose that X has the chi-square distribution with n degrees of freedom.

Mathematical Exercise 6. Show that

  1. E(X) = n
  2. var(X) = 2n

Mathematical Exercise 7. Show that

E(Xk) = 2k gam(n/2 + k) / gam(n/2).

Mathematical Exercise 8. Show that

E[exp(tX)] = (1 - 2t)-n/2 for t < 1/2.

Simulation Exercise 9. In the simulation of the random variable experiment, select the chi-square distribution. Vary n with the scroll bar and note the size and location of the mean/standard deviation bar. With n = 4, run the simulation 1000 times with an update frequency of 10 and note the apparent convergence of the empirical moments to the distribution moments.

Transformations

Mathematical Exercise 10. Suppose that Z has the standard normal distribution. Use change of variable techniques to show that U = Z2 has the chi-square distribution with 1 degree of freedom.

Mathematical Exercise 11. Use moment generating functions or properties of the gamma distribution to show that if X has the chi-square distribution with m degrees of freedom, Y has the chi-square distribution with n degrees of freedom, and X and Y are independent, then X + Y has the chi-square distribution with m + n degrees of freedom.

Mathematical Exercise 12. Suppose that Z1, Z2, ..., Zn are independent standard normal variables (that is, a random sample of size n from the standard normal distribution). Use the results of the previous two exercises to show that

V = Z12 + Z22 + ··· + Zn2

has the chi-square distribution with n degrees of freedom.

The result of the last exercise is the reason that the chi-square distribution deserves a name of its own. Sums of squares of independent normal variables occur frequently in statistics. On the other hand, the following exercise shows that any gamma distributed variable can be rescaled into a variable with a chi-square distribution.

Mathematical Exercise 13. Suppose that X has the gamma distribution with shape parameter k and scale parameter b. Show that Y = 2X / b has the chi-square distribution with 2k degrees of freedom.

Mathematical Exercise 14. Suppose that a missile is fired at a target at the origin of a plane coordinate system, with units in meters. The missile lands at (X, Y) where X and Y are independent and each has the normal distribution with mean 0 and variance 100. The missile will destroy the target if it lands within 20 meters of the target. Find the probability of this event.

Normal Approximation

From the central limit theorem, and previous results for the gamma distribution, it follows that if n is large, the chi-square distribution with n degrees of freedom can be approximated by the normal distribution with mean n and variance 2n. More precisely, if X has the chi-square distribution with n degrees of freedom, then the distribution of the standardized variable

(X - n) / (2n)1/2,

converges to the standard normal distribution as n increases to infinity:

Simulation Exercise 15. In the simulation of the random variable experiment, select the chi-square distribution. Start with n = 1 and increase n. Note the shape of the density function. With n = 20, run the experiment 1000 times with an update frequency of 10 and note the apparent convergence of the empirical density function to the true density function.

Simulation Exercise 16. Suppose that X has the chi-square distribution with n = 18 degrees of freedom. For each of the following, compute the true value using the quantile applet and then compute the normal approximation. Compare.

  1. P(15 < X < 20)
  2. The 75th percentile of X.