The Kolmogorov-Smirnov test is a test for goodness of fit of data to a distribution. It is often used to test whether a variable is normally distributed.

The Kolmogorov-Smirnov test tests the hypothesis that two independent random samples come from the same distribution. The KS statistic is the supremum of the absolute difference of the empirical cumulative distribution functions of the two samples.

The KS test can be used as a one-sample test of the hypothesis that the sample is drawn from a pre-specified (!) theoretical distribution (e.g., a particular normal distribution). Note that fitting a distribution to data and then using the KS test to test whether the data conform to this distribution is invalid!

history | excerpt history