Andromeda
Note

Kolmogorov-Smirnov (KS) Test

Definition

The Kolmogorov-Smirnov (KS) Test is a non-parametric test of the equality of continuous, one-dimensional probability distributions. In simulation, it is used as an alternative to the Chi-Square test when the available data sample is small.

Why It Matters

In simulation, a bad “guess” at the input distribution leads to a useless model. The KS test provides the mathematical rigor needed to verify that your data actually matches your assumptions, ensuring that your simulations are “grounded” in reality.

Core Concepts

  • Empirical Distribution Function (EDF): The test compares the cumulative distribution function (CDF) of the observed data against the CDF of the theoretical distribution.

  • The Statistic (DD): The maximum absolute difference between the theoretical CDF and the empirical CDF (D=maxF(x)Sn(x)D = \max |F(x) - S_n(x)|).

    • How to read: “The value D equals the maximum of the absolute difference between F of x and S n of x.”
    • Meaning / when to use: DD is the largest vertical gap between the fitted and observed CDFs—bigger DD means worse fit; compare to critical values to accept or reject the distribution.
  • Advantage over Chi-Square:

    • Does not require grouping data into cells (eliminates cell-size bias).
    • Valid for very small sample sizes (<20< 20 points).
  • Limitation: Only strictly valid for continuous distributions where parameters are known, not estimated from the sample.

Connected Concepts