
ks.test
from package stats
, but using an improved
routine.
ks.test.imp(x, y, ...)
pnorm
. Only continuous CDFs
are valid.y
."htest"
containing the following components:
ks.test(x, y, ..., exact=TRUE)
but uses
an improved method based on pkolmim
. For more details about
the arguments, please refer to the documentation for ks.test
.
pkolmim
for the cumulative distribution function of
Kolmogorov's goodness-of-fit measure.
x <- abs(rnorm(100))
p.kt <- ks.test(x, "pexp", exact = TRUE)$p
p.ktimp <- ks.test.imp(x, "pexp")$p
abs(p.kt - p.ktimp)
# compare execution times
x <- abs(rnorm(2000))
system.time(ks.test.imp(x, "pexp"))
system.time(ks.test(x, "pexp", exact = TRUE))
Run the code above in your browser using DataLab