Kolmogorov-Smirnov test

From Wikipedia, the free encyclopedia

(Redirected from Kolmogorov-Smirnov)
Jump to: navigation, search

In statistics, the KolmogorovSmirnov test (often called the K-S test) is a goodness of fit test used to determine whether two underlying one-dimensional probability distributions differ, or whether an underlying probability distribution differs from a hypothesized distribution, in either case based on finite samples.

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[citation needed].

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.

Contents

The empirical distribution function Fn for n iid observations Xi is defined as

F_n(x)={1 \over n}\sum_{i=1}^n I_{X_i\leq x}

where I_{X_i\leq x} is the indicator function.

The Kolmogorov-Smirnov statistic for a given function F(x) is

D_n=\sup_x |F_n(x)-F(x)|,

where \sup S is the supremum of set S. By the Glivenko-Cantelli theorem, if the sample comes from distribution F(x), then Dn 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.

The Kolmogorov distribution is the distribution of the random variable

K=\sup_{t\in[0,1]}|B(t)|,

where B(t) is the Brownian bridge. The cumulative distribution function of K is given by

\operatorname{Pr}(K\leq x)=1-2\sum_{i=1}^\infty (-1)^{i-1} e^{-2i^2 x^2}=\frac{\sqrt{2\pi}}{x}\sum_{i=1}^\infty e^{-(2i-1)^2\pi^2/(8x^2)}.

Under null hypothesis that the sample comes from the hypothesized distribution F(x),

\sqrt{n}D_n\xrightarrow{n\to\infty}\sup_t |B(F(t))| in distribution, where B(t) is the Brownian bridge.

If F is continuous then under the null hypothesis \sqrt{n}D_n 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

\sqrt{n}D_n>K_\alpha,

where Kα is found from

\operatorname{Pr}(K\leq K_\alpha)=1-\alpha.

When n is big enough, this approximation may be used:

K_\alpha \approx \sqrt{-\frac{\ln{\frac{1-\alpha}{2}}}{2 n}}-\frac{1}{6 n}.

The asymptotic power of this test is 1. If the form or parameters of F(x) are determined from the Xi, the inequality may not hold. In this case, Monte Carlo or other methods are required to determine the rejection level α.

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

D_{n,n'}=\sup_x |F_n(x)-F_{n'}(x)|.

and the null hypothesis is rejected at level α if

\sqrt{\frac{n n'}{n + n'}}D_{n,n'}>K_\alpha.

While the Kolmogorov-Smirnov test is usually used to test whether a given F(x) is the underlying probability distribution of Fn(x), the procedure may be inverted to give confidence limits on F(x) itself. If one chooses a critical value of the test statistic Dα such that P(Dn > Dα) = α, then a band of width ±Dα around Fn(x) will entirely contain F(x) with probabilitiy 1 − α.

Eadie, W.T.; D. Drijard, F.E. James, M. Roos and B. Sadoulet (1971). Statistical Methods in Experimental Physics. Amsterdam: North-Holland, 269-271. 

Stuart, Alan; Keith Ord and Steven Arnold (1999). Kendall's Advanced Theory of Statistics. London: Arnold, a member of the Hodder Headline Group, 25.37-25.43. 


Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.