In this lecture we discuss how to compute the values of the Chi-square distribution function, using Chi-square distribution tables or computer programs (in particular Matlab or Excel). For an introduction to the Chi-square distribution, see the lecture entitled Chi-square distribution.
Let
be a Chi-square random variable with
degrees of freedom and denote its distribution
function by
As we have discussed in the lecture entitled
Chi-square distribution, there is no simple
analytical expression for
and its values are usually looked up in a table or computed with a computer
algorithm.
This lecture discusses the practical problem of computing numerically the
values of
when
is a specific number (e.g.
).
In the past, when computers were not widely available, people used to look up
the values of
in Chi-square distribution tables.
A Chi-square distribution table is a table where some
critical values of
are tabulated for several values of the degrees of freedom parameter
.
A Chi-square distribution table looks something like
this:
For example, at the intersection of the row corresponding to
degrees of freedom and the column corresponding to a value of the distribution
function of
,
we read the value
.
This means
that:
In
other words, the probability that a Chi-square random variable with
degrees of freedom is less than
is
.
If we are searching for a value of
that does not correspond to one of the critical values in the first row, then
a Chi-square distribution table is not of any help. In this case, we need to
use a computer algorithm (see below).
To compute the values of the Chi-square distribution function
,
we can use the built-in Excel function CHISQ.DIST().
For example, if we need to compute
and the value
is stored in cell A1, we can type in another cell:
=CHISQ.DIST(A1,5)
To compute the values of the Chi-square distribution function
,
we can use the Matlab function chi2cdf(), which takes
the value
as its first argument and the number of degrees of freedom
as its second argument. For example, if we need to compute
,
we can input the following command:
chi2cdf(1,5)
At the end of the lecture entitled Chi-square distribution, you can find some solved exercises that also require the computation of Chi-square distribution values.