From octave-sources-request at bevo dot che dot wisc dot edu Tue Aug 28 17:04:12 2001 Subject: Kolmogorov-Smirnov CDF From: "James R. Van Zandt" To: "Octave contributions" at vanzandt dot mv dot com, octave-sources@bevo.che.wisc.edu Cc: Kurt Hornik Date: Mon, 27 Aug 2001 21:50:38 -0400 (EDT) Kurt Hornik contributed kolmogorov_smirnov_cdf.m to Octave some time ago. It's described this way: - Function File: kolmogorov_smirnov_cdf (X, TOL) Return the CDF at X of the Kolmogorov-Smirnov distribution, Inf Q(x) = SUM (-1)^k exp(-2 k^2 x^2) k = -Inf for X > 0. However, the Kolmogorov-Smirnov tables I have found all have two parameters, like the chi-square distribution. One parameter is the number of degrees of freedom. The other is one of three values that indicate the difference between the cumulative distribution of the sample, S(x[j]), and the reference cumulative distribution, F(x): Dn+ = MAX( S(x[j]) - F(x[j]) ) Dn- = MAX( F(x[j]) - S(x[j]) ) Dn* = MAX( ABS( S(x[j]) - F(x[j]) ) ) (I think the third "two-sided" one is the most useful version, and that is what I have found tabulated. Apparently it is more difficult to calculate its distribution than the "one-sided" versions. The latter are implemented here: http://www.ciphersbyritter.com/JAVASCRP/NORMCHIK.HTM) What is the relationship between the distribution calculated by Octave's function and the tabulated distribution? I'd like to add that to the documentation. - Jim Van Zandt