The one-sample KS test compares the empirical distribution function with the cumulative distribution function specified by the null hypothesis. The main applications are testing goodness of fit with the normal and uniform distributions. For normality testing, minor improvements made by Lilliefors lead to the Lilliefors test. In general the Shapiro-Wilk test or Anderson-Darling test are more powerful alternatives to the Lilliefors test for testing normality.
The two-sample KS test is one of the most useful and general nonparametric methods for comparing two samples, as it is sensitive to differences in both location and shape of the empirical cumulative distribution functions of the two samples.
Kolmogorov-Smirnov statistic
The empirical distribution function Fn for n iid observations Xi is defined as
The Kolmogorov-Smirnov statistic for a given function F(x) is
where is the supremum of set . By the Glivenko-Cantelli theorem, if the sample comes from distribution F(x), then converges to 0 almost surely. Kolmogorov strengthened this result, by effectively providing the rate of this convergence (see below). The Donsker theorem provides yet stronger result.
Kolmogorov distribution
The Kolmogorov distribution is the distribution of the random variablewhere is the Brownian bridge. The cumulative distribution function of K is given by
Kolmogorov-Smirnov test
Under null hypothesis that the sample comes from the hypothesized distribution F(x),in distribution, where B(t) is the Brownian bridge.
If F is continuous then under the null hypothesis converges to the Kolmogorov distribution, which does not depend on F. This result may also be known as the Kolmogorov theorem; see Kolmogorov's theorem for disambiguation.
The goodness-of-fit test or the Kolmogorov-Smirnov test is constructed by using the critical values of the Kolmogorov distribution.
The null hypothesis is rejected at level if
where is found from
The asymptotic power of this test is 1. If the form or parameters of are determined from the , the inequality may not hold. In this case, Monte Carlo or other methods are required to determine the rejection level .
A more familiar form of the test is:
found on different references.
The Kolmogorov-Smirnov test may also be used to test whether two underlying one-dimensional probability distributions differ. In this case, the Kolmogorov-Smirnov statistic is
and the null hypothesis is rejected at level if
Setting confidence limits for the shape of a distribution function
While the Kolmogorov-Smirnov test is usually used to test whether a given is the underlying probability distribution of , the procedure may be inverted to give confidence limits on itself. If one chooses a critical value of the test statistic such that , then a band of width ± around will entirely contain with probabilitiy .
See also
- Non-parametric statistics
- Andrey Kolmogorov
- Lilliefors test
- Jarque-Bera test
- Shapiro-Wilk test
- Anderson-Darling test
- Kuiper's test
- Cramér-von-Mises test
- Donsker theorem
- Siegel-Tukey test
References
**
External links
- Short introduction
- KS test explanation
- JavaScript implementation of one- and two-sided tests
- Online calculator with the K-S test
- Open-source C++ code to compute the Kolmogorov distribution and perform the K-S test
This article is licensed under the GNU Free Documentation License.
Last updated on Monday June 02, 2008 at 15:21:08 PDT (GMT -0700)
View this article at Wikipedia.org - Edit this article at Wikipedia.org - Donate to the Wikimedia Foundation
Copyright © 2008, Dictionary.com, LLC. All rights reserved.













