Computing the cumulative distribution function of the Kolmogorov-Smirnov statistic
We present an algorithm for computing the cumulative distribution function of the Kolmogorov-Smirnov test statistic D-n in the all-parameters-known case. Birnbaum (1952, J. Amer. Statist. Assoc. 47, 425-441), gives an n-fold integral for the CDF of the test statistic which yields a function defined in a piecewise fashion, where each piece is a polynomial of degree n. Unfortunately, it is difficult to determine the appropriate limits of integration for computing these polynomials. Our algorithm performs the required integrations in a manner that avoids calculating the same integrals repeatedly, resulting in shorter computation time. It can be used to compute the entire CDF or just a portion of the CDF, which is more efficient for finding a critical value or a p-value associated with a hypothesis test. If the entire CDF is computed, it can be stored in memory so that various characteristics of the distribution of the test statistic (e.g., moments) can be calculated. To date, critical tables have been approximated by various techniques including asymptotic approximations, recursive formulas, and Monte Carlo simulation. Our approach yields exact critical values and significance levels. The algorithm has been implemented in a computer algebra system. (C) 2000 Elsevier Science B.V. All rights reserved.
algorithm computer algebra systems continuous probability distributions goodness-of-it tests probability