mathematics//statistics//chi-square distribution
The chi-square distribution is the probability distribution of a sum of squares of independent standard normal variables, and it is where engineers get the thresholds for every test that measures a surprise in sigmas squared: innovation gates in trackers, consistency checks of a Kalman filter, the \(T^2\) chart of a process monitor. With \(k\) squared standard normals,
The chi-square distribution is the probability distribution of a sum of squares of independent standard normal variables, and it is where engineers get the thresholds for every test that measures a surprise in sigmas squared: innovation gates in trackers, consistency checks of a Kalman filter, the T2T^2T2 chart of a process monitor. With kkk squared standard normals,
q=z12+z22+⋯+zk2 ∼ χk2,q=z_1^2+z_2^2+\cdots+z_k^2\;\sim\;\chi^2_k ,q=z12+z22+⋯+zk2∼χk2,
where kkk is the number of degrees of freedom. Its mean is kkk and its variance 2k2k2k: each term contributes about 1 on average, and the sum is never negative.
The reason it is everywhere is the Mahalanobis distance. If a vector xxx of kkk quantities is Gaussian with mean μ\muμ and covariance Σ\SigmaΣ, whitening it turns the squared distance d2=(x−μ)TΣ−1(x−μ)d^2=(x-\mu)^{\mathsf T}\Sigma^{-1}(x-\mu)d2=(x−μ)TΣ−1(x−μ) into exactly such a sum, so d2d^2d2 follows χk2\chi^2_kχk2. A motor's temperature, current and vibration read together (k=3k=3k=3) should give d2d^2d2 around 3, and 95 % of healthy readings satisfy d2<7.8d^2<7.8d2<7.8.
The cut-offs worth knowing are 3.84, 5.99 and 7.81 at 95 % for one, two and three quantities, and 6.63, 9.21 and 11.34 at 99 %. The gate grows with kkk because more quantities give more room to be a little off in each.
It tests whether a filter lies. In a consistent Kalman filter the innovation normalised by its predicted covariance (NIS) is χm2\chi^2_mχm2 with mmm measurements, so its average should sit near mmm. An average of 5 for a single measurement says the filter is far too sure of itself (filter consistency).
It sets the gate in tracking and anomaly detection. A radar return whose d2d^2d2 exceeds the 99 % cut-off is not considered for a track (innovation gating, data association), and a plant monitor flags a reading by the same rule (T-squared statistic).
The percentages hold only under the assumptions. With heavy-tailed noise, a covariance that is wrong or readings that are correlated in time, the share beyond the cut-off is larger than advertised; the ranking of points by d2d^2d2 stays useful even when the stated false alarm rate is wrong (heavy-tailed distribution).
The same distribution judges a histogram against a model (goodness of fit) and gives the interval of a variance estimated from NNN Gaussian readings, (N−1)s2/σ2∼χN−12(N-1)s^2/\sigma^2\sim\chi^2_{N-1}(N−1)s2/σ2∼χN−12.