Kolmogorov-Smirnov test.
Distribution free criterion for homogeneity testing.
Let assume that we have N = m + n observations x1...xm and y1...yn
Suppose:
- All N observations X and Y are mutually independent.
- All X derived from the entire assembly Π1.
- All Y derived from the entire assembly Π2.
Method
Will test hypothesis that both populations Π1 and Π2 are identical, i.e.
both samples were derived from the single population.
It can be rewrited:
H0: F(x) = G(x) ∀x.
To test our hypothesis we:
- Arrange our observations X and Y: x1<x2<…<xm; y1<y2<…<yn.
- Evaluate Kolmogorov-Smirnov statistic, which measures difference
between empirical distribution functions, obtained with respect to
samples X and Y:

where Dm,n=max|Fn(x)-G(x)m|
- When m and n tend to ∞, distribution of this statistic upon condition,
that H0 hypothesis is true, tends to Kolmogorov distribution function:
- So P-value = 1 - K(SCM).