Skip to content
Prev 6346 / 63424 Next

ks.test (PR#1004)

charlie@muskrat.stat.umn.edu writes:
Here's part of the problem:

Browse[1]> .C("psmirnov2x", p = as.double(STATISTIC), as.integer(n.x),
as.integer(n.y), PACKAGE = "ctest")$p
[1] 0.9876594
Browse[1]> .C("psmirnov2x", p = as.double(0.6), as.integer(n.x),
as.integer(n.y), PACKAGE = "ctest")$p
[1] 0.9475524
Browse[1]> STATISTIC
[1] 0.6

Perplexed? The reason is of course that

Browse[1]> STATISTIC-0.6
[1] 1.110223e-16

and the KS distribution is discontinuous, so the point probability at
0.6 didn't get counted. Looks like we need a fudge factor.