# Understanding the Kolmogorov–Smirnov test

1. Apr 22, 2013

### JoePhysicsNut

Dear all,

I am using some software to perform a two-sample Kolmogorov–Smirnov test. Specifically, I am testing the compatibility of two histograms.

The function returns a single number that is 1 for a perfect match (when I compare the histogram to itself) and somewhere between 0.05 to 0.25 for histograms that show reasonable compatibility.

The method seems to work as I expect, but there is a sentence in the description of the function that I do not understand:

"The returned value PROB is calculated such that it will be uniformly distributed between zero and one for compatible histograms".

Each test yields one value not many, so can't be distributed in any way. If it's over many tests, then compatible histograms should yield a high value for PROB and incompatible ones a low value. Why/how would the distribution be uniform?

Note that I'm not a statistics expert to a friendly explanation would be very welcome.

2. Apr 22, 2013

### Stephen Tashi

Perhaps the documentation is a mangled attempt to say that the distribution of the KS two sample statistic is the same if both distributions are the same - regardless of the shape of the common distribution. Hence the distribution of the KS statistic can be calculated by assuming the common distribution is a uniform distribution for the sake of simplicity. ( - so says a poster in http://stats.stackexchange.com/questions/17495/kolmogorov-smirnov-two-sample-p-values)