Kolmogorov–Smirnov test
Kolmogorov–Smirnov test (K–S test) is a nonparametric test used in statistics to compare a sample with a reference probability distribution (one-sample K–S test), or to compare two samples (two-sample K–S test). It is named after Andrey Kolmogorov and Nikolai Smirnov. The K–S test 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 hypothesis of the test is that the sample comes from the same distribution as the reference distribution (in the one-sample case), or that the two samples come from the same distribution (in the two-sample case).
Definition[edit]
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. For a one-sample K–S test, the test statistic is:
\[D_n = \sup_x |F_n(x) - F(x)|\]
where \(F_n(x)\) is the empirical distribution function of the sample and \(F(x)\) is the cumulative distribution function of the reference distribution. For a two-sample K–S test, the test statistic is:
\[D_{n,m} = \sup_x |F_{n}(x) - G_{m}(x)|\]
where \(F_{n}(x)\) and \(G_{m}(x)\) are the empirical distribution functions of the two samples, with \(n\) and \(m\) being the sizes of the samples, respectively.
Applications[edit]
The K–S test is widely used in situations where the form of the distribution is not known and for comparing the goodness-of-fit of empirical data to a theoretical model. It is particularly useful in the fields of statistics, economics, psychology, and environmental science, among others.
Advantages and Limitations[edit]
One of the main advantages of the K–S test is its nonparametric nature, meaning it does not assume a specific distribution for the data. However, the test has less power than some alternatives, such as the Anderson-Darling test, especially for small sample sizes or when the differences between distributions are in the tails.
Implementation[edit]
The K–S test has been implemented in various statistical software packages, including R, Python's SciPy library, and MATLAB. These implementations typically provide functions to perform both one-sample and two-sample tests, along with options to adjust for the effect of discrete data or ties.
See Also[edit]
- Nonparametric statistics
- Cumulative distribution function
- Empirical distribution function
- Anderson-Darling test
This article is a statistics-related stub. You can help WikiMD by expanding it!
-
Example of a Kolmogorov–Smirnov test
-
Probability density function of the Kolmogorov distribution
-
Another example of a Kolmogorov–Smirnov test
Ad. Transform your health with W8MD Weight Loss, Sleep & MedSpa

Tired of being overweight?
Special offer:
Budget GLP-1 weight loss medications
- Semaglutide starting from $29.99/week and up with insurance for visit of $59.99 and up per week self pay.
- Tirzepatide starting from $45.00/week and up (dose dependent) or $69.99/week and up self pay
✔ Same-week appointments, evenings & weekends
Learn more:
- GLP-1 weight loss clinic NYC
- W8MD's NYC medical weight loss
- W8MD Philadelphia GLP-1 shots
- Philadelphia GLP-1 injections
- Affordable GLP-1 shots NYC
- Budget GLP-1 shots
|
WikiMD Medical Encyclopedia |
Medical Disclaimer: WikiMD is for informational purposes only and is not a substitute for professional medical advice. Content may be inaccurate or outdated and should not be used for diagnosis or treatment. Always consult your healthcare provider for medical decisions. Verify information with trusted sources such as CDC.gov and NIH.gov. By using this site, you agree that WikiMD is not liable for any outcomes related to its content. See full disclaimer.
Credits:Most images are courtesy of Wikimedia commons, and templates, categories Wikipedia, licensed under CC BY SA or similar.
Translate this page: - East Asian
中文,
日本,
한국어,
South Asian
हिन्दी,
தமிழ்,
తెలుగు,
Urdu,
ಕನ್ನಡ,
Southeast Asian
Indonesian,
Vietnamese,
Thai,
မြန်မာဘာသာ,
বাংলা
European
español,
Deutsch,
français,
Greek,
português do Brasil,
polski,
română,
русский,
Nederlands,
norsk,
svenska,
suomi,
Italian
Middle Eastern & African
عربى,
Turkish,
Persian,
Hebrew,
Afrikaans,
isiZulu,
Kiswahili,
Other
Bulgarian,
Hungarian,
Czech,
Swedish,
മലയാളം,
मराठी,
ਪੰਜਾਬੀ,
ગુજરાતી,
Portuguese,
Ukrainian