Home / Shared Math Details / Shared Estimators and Tests / Kolmogorov-Smirnov Test
Kolmogorov-Smirnov Test¶
This page defines the Kolmogorov-Smirnov normality test that Quantum XL uses, including the sample-size modification applied because the normal parameters are estimated from the same data. It is one of the selectable goodness-of-fit methods wherever a normality check is offered.
Notation¶
| Term | Description |
|---|---|
| \(n\) | number of data values |
| \(x_{(1)} \le x_{(2)} \le \cdots \le x_{(n)}\) | the data sorted in ascending order |
| \(\bar{x}\) | sample mean |
| \(s\) | sample standard deviation (\(n - 1\) denominator) |
| \(F_n\) | empirical cumulative distribution function |
| \(\Phi\) | standard normal cumulative distribution function |
| \(z_{(i)}\) | standardized sorted value, \((x_{(i)} - \bar{x})/s\) |
| \(D\) | Kolmogorov-Smirnov statistic |
| \(D^{*}\) | sample-size modified statistic used for the p-value |
Test statistic¶
\(F_n\) is the empirical cumulative distribution function of the sorted data, and \(z_{(i)} = (x_{(i)} - \bar{x})/s\) standardizes each value with the sample mean and sample standard deviation. \(D\) is the largest vertical distance between the empirical CDF and the fitted normal CDF.
p-value¶
Because the mean and standard deviation are estimated from the same sample, the classical Kolmogorov-Smirnov distribution does not apply. Quantum XL forms a sample-size modified statistic:
and reads the p-value from tabulated critical values for the case where the mean and variance are estimated from the sample, interpolating linearly within each bracket:
| Modified statistic | Reported p-value |
|---|---|
| \(D^{*} < 0.775\) | \(0.15\), printed with a greater-than prefix |
| \(0.775 \le D^{*} < 0.819\) | \(0.10 + 0.05\left(1 - \dfrac{D^{*} - 0.775}{0.044}\right)\) |
| \(0.819 \le D^{*} < 0.895\) | \(0.05 + 0.05\left(1 - \dfrac{D^{*} - 0.819}{0.076}\right)\) |
| \(0.895 \le D^{*} < 0.995\) | \(0.025 + 0.025\left(1 - \dfrac{D^{*} - 0.895}{0.100}\right)\) |
| \(0.995 \le D^{*} < 1.035\) | \(0.01 + 0.015\left(1 - \dfrac{D^{*} - 0.995}{0.040}\right)\) |
| \(D^{*} \ge 1.035\) | \(0.01\), printed with a less-than prefix |
So the reportable p-value range is exactly \(0.01\) to \(0.15\). Outside the table the value is pinned to the nearer endpoint and printed with a prefix, for example > 0.15 for a sample that agrees closely with the normal model.
Kolmogorov-Smirnov also requires variation in the data: when the standard deviation is zero, no statistic and no p-value are reported.
Used by¶
- Summary Statistics: the normality-test section.
- Cpk/Histogram Math Details: the selectable goodness-of-fit method.
- Variable control charts with capability attached: Xbar-R, Xbar-S, I-MR, and I-MR-R/S, when a specification limit or target is entered. See Goodness of Fit for that behavior.
See Also¶
References¶
- Massey, F. J. (1951). The Kolmogorov-Smirnov test for goodness of fit. Journal of the American Statistical Association, 46(253), 68-78.
- Lilliefors, H. W. (1967). On the Kolmogorov-Smirnov test for normality with mean and variance unknown. Journal of the American Statistical Association, 62(318), 399-402.
- Stephens, M. A. (1974). EDF statistics for goodness of fit and some comparisons. Journal of the American Statistical Association, 69(347), 730-737.
- D'Agostino, R. B., and Stephens, M. A. (1986). Goodness-of-Fit Techniques. Marcel Dekker.