info prev up next book cdrom email home

Chi-Squared Distribution

A $\chi^2$ distribution is a Gamma Distribution with $\theta \equiv 2$ and $\alpha \equiv r/2$, where $r$ is the number of Degrees of Freedom. If $Y_i$ have Normal Independent distributions with Mean 0 and Variance 1, then

\begin{displaymath}
\chi^2\equiv \sum_{i=1}^r {Y_i}^2
\end{displaymath} (1)

is distributed as $\chi^2$ with $r$ Degrees of Freedom. If ${\chi_i}^2$ are independently distributed according to a $\chi^2$ distribution with $r_1$, $r_2$, ..., $r_k$ Degrees of Freedom, then
\begin{displaymath}
\sum_{j=1}^k {\chi_j}^2
\end{displaymath} (2)

is distributed according to $\chi^2$ with $r\equiv \sum_{j=1}^k r_j$ Degrees of Freedom.
\begin{displaymath}
P_r(x) = \cases{
{x^{r/2-1}e^{-x/2}\over\Gamma({\textstyle{...
...) 2^{r/2}} & for $0 \leq x < \infty$\cr
0 & for $x < 0$.\cr}
\end{displaymath} (3)

The cumulative distribution function is then
$\displaystyle D_r(\chi^2)$ $\textstyle =$ $\displaystyle \int_0^{\chi^2} {t^{r/2-1}e^{-t/2}\,dt\over \Gamma({\textstyle{1\over 2}}r) 2^{r/2}}$  
  $\textstyle =$ $\displaystyle {\gamma({\textstyle{1\over 2}}r, {\textstyle{1\over 2}}\chi^2)\ov...
...style{1\over 2}}r)} = P({\textstyle{1\over 2}}r, {\textstyle{1\over 2}}\chi^2),$ (4)

where $P(a,z)$ is a Regularized Gamma Function. The Confidence Intervals can be found by finding the value of $x$ for which $D_r(x)$ equals a given value. The Moment-Generating Function of the $\chi^2$ distribution is
$\displaystyle M(t)$ $\textstyle =$ $\displaystyle (1-2t)^{-r/2}$ (5)
$\displaystyle R(t)$ $\textstyle \equiv$ $\displaystyle \ln M(t) = - {\textstyle{1\over 2}}r \ln(1-2t)$ (6)
$\displaystyle R'(t)$ $\textstyle =$ $\displaystyle {r\over 1-2t}$ (7)
$\displaystyle R''(t)$ $\textstyle =$ $\displaystyle {2r\over (1-2t)^2},$ (8)

so
$\displaystyle \mu$ $\textstyle =$ $\displaystyle R'(0) = r$ (9)
$\displaystyle \sigma^2$ $\textstyle =$ $\displaystyle R''(0) = 2r$ (10)
$\displaystyle \gamma_1$ $\textstyle =$ $\displaystyle 2\sqrt{2\over r}$ (11)
$\displaystyle \gamma_2$ $\textstyle =$ $\displaystyle {12\over r}.$ (12)

The $n$th Moment about zero for a distribution with $r$ Degrees of Freedom is
\begin{displaymath}
m_n'=2^n{\Gamma(n+{\textstyle{1\over 2}}r)\over\Gamma({\textstyle{1\over 2}}r)} = r(r+2)\cdots(r+2n-2),
\end{displaymath} (13)

and the moments about the Mean are
$\displaystyle \mu_2$ $\textstyle =$ $\displaystyle 2r$ (14)
$\displaystyle \mu_3$ $\textstyle =$ $\displaystyle 8r$ (15)
$\displaystyle \mu_4$ $\textstyle =$ $\displaystyle 12r(r+4).$ (16)

The $n$th Cumulant is
\begin{displaymath}
\kappa_n=2^n\Gamma(n) ({\textstyle{1\over 2}}r)=2^{n-1}(n-1)! r.
\end{displaymath} (17)


The Moment-Generating Function is

$\displaystyle M(t)$ $\textstyle =$ $\displaystyle e^{rt/\sqrt{2r}}\left({1-{2t\over\sqrt{2r}}}\right)^{-r/2}$  
  $\textstyle =$ $\displaystyle \left[{e^{t\sqrt{2/r}}\left({1-\sqrt{2\over r}\,t}\right)}\right]^{-r/2}$  
  $\textstyle =$ $\displaystyle \left[{1-{t^2\over r}-{1\over 3}\left({2\over r}\right)^{3/2}t^3-\ldots}\right]^{-r/2}.$ (18)

As $r\to\infty$,
\begin{displaymath}
\lim_{r\to\infty}M(t)=e^{t^2/2},
\end{displaymath} (19)

so for large $r$,
\begin{displaymath}
\sqrt{2\chi^2}=\sqrt{\sum_i {(x_i-\mu_i)^2\over{\sigma_i}^2}}
\end{displaymath} (20)

is approximately a Gaussian Distribution with Mean $\sqrt{2r}$ and Variance $\sigma^2 = 1$. Fisher showed that
\begin{displaymath}
{\chi^2-r\over\sqrt{2r-1}}
\end{displaymath} (21)

is an improved estimate for moderate $r$. Wilson and Hilferty showed that
\begin{displaymath}
\left({\chi^2\over r}\right)^{1/3}
\end{displaymath} (22)

is a nearly Gaussian Distribution with Mean $\mu=1-2/(9r)$ and Variance $\sigma^2=2/(9r)$.


In a Gaussian Distribution,

\begin{displaymath}
P(x)\,dx={1\over\sigma\sqrt{2\pi}} e^{-(x-\mu)^2/2\sigma^2}\,dx,
\end{displaymath} (23)

let
\begin{displaymath}
z \equiv (x-\mu )^2/\sigma^2.
\end{displaymath} (24)

Then
\begin{displaymath}
dz = {2(x-\mu)\over \sigma^2} \,dx = {2\sqrt{z}\over \sigma} \,dx
\end{displaymath} (25)

so
\begin{displaymath}
dx={\sigma\over 2\sqrt{z}} dz.
\end{displaymath} (26)

But
\begin{displaymath}
P(z)\,dz=2 P(x)\,dx,
\end{displaymath} (27)

so
\begin{displaymath}
P(x)\,dx=2\,{1\over \sigma\sqrt{2\pi}} e^{-z/2}\,dz = {1\over \sigma\sqrt{\pi}}
e^{-z/2}\,dz.
\end{displaymath} (28)

This is a $\chi^2$ distribution with $r = 1$, since
\begin{displaymath}
P(z)\,dz={z^{1/2-1}e^{-z/2}\over \Gamma({1\over 2})2^{1/2}}\,dz = {x^{-1/2}e^{-1/2}\over \sqrt{2\pi}}\,dz.
\end{displaymath} (29)


If $X_i$ are independent variates with a Normal Distribution having Means $\mu_i$ and Variances ${\sigma_i}^2$ for $i=1$, ..., $n$, then

\begin{displaymath}
{\textstyle{1\over 2}}\chi^2\equiv \sum_{i=1}^n {(x_i-\mu_i)^2\over 2{\sigma_i}^2}
\end{displaymath} (30)

is a Gamma Distribution variate with $\alpha=n/2$,
\begin{displaymath}
P({\textstyle{1\over 2}}\chi^2)\,d({\textstyle{1\over 2}}\ch...
...{1\over 2}}\chi^2)^{(n/2)-1}\,d({\textstyle{1\over 2}}\chi^2).
\end{displaymath} (31)


The noncentral chi-squared distribution is given by

\begin{displaymath}
P(x)= 2^{-n/2}e^{-(\lambda+x)/2}x^{n/2-1}F({\textstyle{1\over 2}}n, {\textstyle{1\over 4}}\lambda x),
\end{displaymath} (32)

where
\begin{displaymath}
F(a,z)\equiv {{}_0F_1(; a; z)\over \Gamma(a)},
\end{displaymath} (33)

${}_0F_1$ is the Confluent Hypergeometric Limit Function and $\Gamma$ is the Gamma Function. The Mean, Variance, Skewness, and Kurtosis are
$\displaystyle \mu$ $\textstyle =$ $\displaystyle \lambda+n$ (34)
$\displaystyle \sigma^2$ $\textstyle =$ $\displaystyle 2(2\lambda+n)$ (35)
$\displaystyle \gamma_1$ $\textstyle =$ $\displaystyle {2\sqrt{2}\,(3\lambda+n)\over (2\lambda+n)^{3/2}}$ (36)
$\displaystyle \gamma_2$ $\textstyle =$ $\displaystyle {12(4\lambda+n)\over (2\lambda+n)^2}.$ (37)

See also Chi Distribution, Snedecor's F-Distribution


References

Abramowitz, M. and Stegun, C. A. (Eds.). Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, 9th printing. New York: Dover, pp. 940-943, 1972.

Beyer, W. H. CRC Standard Mathematical Tables, 28th ed. Boca Raton, FL: CRC Press, p. 535, 1987.

Press, W. H.; Flannery, B. P.; Teukolsky, S. A.; and Vetterling, W. T. ``Incomplete Gamma Function, Error Function, Chi-Square Probability Function, Cumulative Poisson Function.'' §6.2 in Numerical Recipes in FORTRAN: The Art of Scientific Computing, 2nd ed. Cambridge, England: Cambridge University Press, pp. 209-214, 1992.

Spiegel, M. R. Theory and Problems of Probability and Statistics. New York: McGraw-Hill, pp. 115-116, 1992.



info prev up next book cdrom email home

© 1996-9 Eric W. Weisstein
1999-05-26