The chi-square distribution is commonly used in hypothesis testing, particularly the chi-squared test for goodness of fit.
The chi-square distribution uses the following parameter.
|ν||Degrees of freedom||ν is a positive value|
The probability density function (pdf) is
where Γ( · ) is the Gamma function, ν is the
degrees of freedom, and x ≥
The cumulative distribution function (cdf) is
where Γ( · ) is the Gamma
function, ν is the degrees of freedom, and x ≥
The mean is ν.
The variance is
The χ2 distribution is a special case of the gamma distribution where b = 2 in the equation for gamma distribution below.
The χ2 distribution gets special attention because of its importance in normal sampling theory. If a set of n observations is normally distributed with variance σ2, and s2 is the sample variance, then
This relationship is used to calculate confidence intervals for the estimate of the normal
parameter σ2 in the function
Compute the pdf of a chi-square distribution with 4 degrees of freedom.
x = 0:0.2:15; y = chi2pdf(x,4);
Plot the pdf.
The chi-square distribution is skewed to the right, especially for few degrees of freedom.