In
statistics, the
Kolmogorov–Smirnov test (
K–S test or
KS test) is a
nonparametric test of the equality of continuous, one-dimensional
probability distributions that can be used to compare a
sample with a reference probability distribution (one-sample K–S test), or to compare two samples (two-sample K–S test). The Kolmogorov–Smirnov statistic quantifies a
distance between the
empirical distribution function of the sample and the
cumulative distribution function of the reference distribution, or between the empirical distribution functions of two samples. The
null distribution of this statistic is calculated under the
null hypothesis that the samples are drawn from the same distribution (in the two-sample case) or that the sample is drawn from the reference distribution (in the one-sample case). In each case, the distributions considered under the null hypothesis are continuous distributions but are otherwise unrestricted.