# NOT RUN {
# Long CPU time, arguments slightly modified to run faster and TAC had.
# TAC has maxr=n/2 (the lower tail) but WHA has changed to maxr=3 for
# speed to get the function usable during automated tests.
testMGBvsN3 <- function(n=100, maxr=3, nrep=10000) { # TAC named function
for(r in 1:maxr) {
set.seed(123457)
res1 <- replicate(nrep, { x <- sort(rnorm(n))
c(MGBTcohn2011(x,r),BLlo(x,r),RSlo(x,r)) })
r1 <- rank(res1[1,]); r2 <- rank(res1[2,]); r3 <- rank(res1[3,])
v <- quantile(r1,.1); h <- quantile(r2,.1)
plot(r1,r2)
abline(v=v, col=2); abline(h=h, col=2)
message(' BLlo ',r, " ", cor(r1,r2), " ", mean((r1 <= v) & (r2 <= h)))
v <- quantile(r1,.1); h <- quantile(r2,.1)
plot(r1,r3)
abline(v=v, col=2); abline(h=h, col=2)
mtext(paste0("Order statistic iteration =",r," of ",maxr))
message('RSTlo ',r, " ", cor(r1,r3), " ", mean((r1 <= v) & (r3 <= h)))
}
}
testMGBvsN3() #
# }
Run the code above in your browser using DataLab