Kolmogorov-Smirnov (K-S) Test

Overview

The Kolmogorov-Smirnov test is a non-parametric test used to determine whether a sample comes from a specified continuous distribution.

  • Null Hypothesis (H₀): The data follow a specified distribution
  • Alternative Hypothesis (H₁): The data do not follow the specified distribution

Test Statistic

The K-S statistic measures the maximum difference between the empirical cumulative distribution function (ECDF) of the sample and the cumulative distribution function (CDF) of the reference distribution:

\[ D = \sup_x |F_n(x) - F(x)| \]

Where: - \(F_n(x)\) is the ECDF of the sample
- \(F(x)\) is the fully specified theoretical CDF (must be continuous)

Note: The test requires a fully specified distribution—meaning all parameters (e.g., location, scale) must be known in advance, not estimated from the data.


Characteristics and Limitations

Advantages

  • The K-S test is distribution-free under the null hypothesis: the distribution of the test statistic does not depend on the form of the tested distribution.
  • It is an exact test, unlike the chi-square goodness-of-fit test, which requires large samples for validity.

Limitations

  1. Only applicable to continuous distributions.
  2. More sensitive at the center of the distribution than at the tails.
  3. Requires the distribution to be fully specified; if parameters are estimated from the sample, critical values must be adjusted using simulation or alternative methods.