Chi Square Distribution
The chi square (χ2) distribution, also known as the chi-squared distribution,
is a continuous probability distribution that models the distribution of the sum of the squares of
Definition
The chi square distribution is characterized by a single parameter, the degrees of freedom (n). While typically a positive integer, n can be any positive real number. The distribution is defined for all non-negative real values.
The probability density function (PDF) is given by:
The cumulative distribution function (CDF) is:
where
Applications
The chi-square distribution has numerous important applications in statistical analysis and quality control:
The distribution is fundamental in goodness-of-fit testing, where it helps determine whether sample data conforms to a hypothesized probability distribution.
In contingency table analysis, the chi-square test evaluates whether there is a significant relationship between categorical variables.
Statistical process control relies on chi-square distributions to establish confidence intervals for population variance, enabling effective quality monitoring in manufacturing.
When evaluating regression models, the chi-square test helps assess the goodness-of-fit of the model and validates underlying assumptions.
The distribution plays a crucial role in hypothesis testing for variance components in analysis of variance (ANOVA) procedures.
Properties
| Property | Value |
|---|---|
| Mean | |
| Variance | |
| Skewness | |
| Excess Kurtosis | |
| Entropy |
The chi-square distribution has several notable properties:
The sum of independent chi-square variables is also chi-square distributed with degrees of freedom equal to the sum of the individual degrees of freedom.
For large n, the distribution approaches a normal distribution with mean n and variance 2n.
Relationships to Other Distributions
If Z is standard normal, then
follows a chi-square distribution with 1 degree of freedom.The chi-square distribution is a special case of the gamma distribution with shape
and scale .The ratio of two chi-square distributions divided by their respective degrees of freedom follows an F-distribution.
The ChiSquareDistribution Class
The chi square distribution is implemented by the ChiSquareDistribution class. It has one constructor which takes the degrees of freedom as its only argument. The following constructs a chi square distribution with 10 degrees of freedom:
var chiSquare = new ChiSquareDistribution(10);The ChiSquareDistribution class has one specific property, DegreesOfFreedom, that returns the degrees of freedom of the distribution.
ChiSquareDistribution provides static Sample methods for generating random values. The preferred method uses IRandomSource:
For compatibility, Random overloads are also available. See Introduction to Random Sources for details on creating random sources.
var random = new Pcg64();
double sample = ChiSquareDistribution.Sample(random, 10);The above example uses the Pcg32 to generate uniform random numbers.
References
For more information on the chi-square distribution, refer to the following sources:
Johnson, N. L., Kotz, S., & Balakrishnan, N. (1994). "Continuous Univariate Distributions, Volume 1", Chapter 18. Wiley Series in Probability and Statistics.
Forbes, C., Evans, M., Hastings, N., & Peacock, B. (2011). "Statistical Distributions", Chapter 11. Wiley Series in Probability and Statistics.