[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Kolmogorov-Smirnoff test implementation
From: |
Dupuis |
Subject: |
Kolmogorov-Smirnoff test implementation |
Date: |
Mon, 1 Mar 2010 08:38:53 -0800 (PST) |
Hello,
while trying to understand the logic behind KS test, I noticed Octave
implementation is
ks = sqrt (n) * max (max ([abs(z - (0:(n-1))/n); abs(z - (1:n)/n)]));
pval = 1 - kolmogorov_smirnov_cdf (ks);
where z is the value of the cumulative distribution of points of the sorted
input.
I looked a bit in google, and found references at NIST
(http://www.itl.nist.gov/div898/handbook/eda/section3/eda35g.htm) and in a
1971 paper (On Kolmogorov-Smirnov Type One-Sample Statistics,
Urs R. Maag and Ghislaine Dicaire, Biometrika, Vol. 58, No. 3 (Dec., 1971),
pp. 653-656) : both use the definition
ks = sqrt(n)*max(max([z - (0:(n-1))/n; (1:n)/n - z]))
The difference in Octave case is that it takes the maximum of the absolute
values of each vector of differences, which to me seems stronger than the
NIST implementation. I tried on a randomly generated vector and both
definitions gave the same result.
Could someone please confirm that the Octave implementation does not
overestimate the discrepancy between theoretical and empirical cdf ?
Regards
Pascal
--
View this message in context:
http://old.nabble.com/Kolmogorov-Smirnoff-test-implementation-tp27745843p27745843.html
Sent from the Octave - General mailing list archive at Nabble.com.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Kolmogorov-Smirnoff test implementation,
Dupuis <=