In [1]:
x <- scan("rn01.txt")
x <- sort(x)
n <- length(x)
n
Out[1]:
In [2]:
alpha <- 0.05
epsn <- sqrt(1/(2 * n) * log(2/alpha))
In [3]:
Fn <- (1:n)/n
plot(x, Fn, type="s", lwd=1, ylab="", xlab="x", main="95% DKW-Konfidenzband")
lower <- pmax(Fn - epsn, 0)
upper <- pmin(Fn + epsn, 1)
conf.b <- cbind(lower, upper)
matplot(x, conf.b, type="s", col=2, add=TRUE)
In [4]:
plot(x, Fn, type="s", lwd=1, ylab="", xlab="x", main="95% KS-Konfidenzband")
d <- 1.36/sqrt(n)
lower_ks <- pmax(Fn - d, 0)
upper_ks <- pmin(Fn + d, 1)
conf.b.ks <- cbind(lower_ks, upper_ks)
matplot(x, conf.b.ks, type="s", col=3, add=TRUE)
In [5]:
ks.test(x, pnorm)
Out[5]:
In [6]:
require(nortest)
lillie.test(x)
Out[6]:
In [ ]: