# Rigdon (1995a), p. 357, Tab. 1
p <- 2
r <- 0.25
h4 <- c(8.37, 9.90, 11.89, 13.36, 14.82, 16.72)
for ( i in 1:length(h4) ) cat(paste(h4[i], "\t", round(mewma.arl(r, h4[i], p, ntype="ra")), "\n"))
r <- 0.1
h4 <- c(6.98, 8.63, 10.77, 12.37, 13.88, 15.88)
for ( i in 1:length(h4) ) cat(paste(h4[i], "\t", round(mewma.arl(r, h4[i], p, ntype="ra")), "\n"))
# Rigdon (1995b), p. 372, Tab. 1
if (FALSE) {
r <- 0.1
p <- 4
h <- 12.73
for ( sdelta in c(0, 0.125, 0.25, .5, 1, 2, 3) )
cat(paste(sdelta, "\t",
round(mewma.arl(r, h, p, delta=sdelta^2, ntype="ra", r=25), digits=2), "\n"))
p <- 5
h <- 14.56
for ( sdelta in c(0, 0.125, 0.25, .5, 1, 2, 3) )
cat(paste(sdelta, "\t",
round(mewma.arl(r, h, p, delta=sdelta^2, ntype="ra", r=25), digits=2), "\n"))
p <- 10
h <- 22.67
for ( sdelta in c(0, 0.125, 0.25, .5, 1, 2, 3) )
cat(paste(sdelta, "\t",
round(mewma.arl(r, h, p, delta=sdelta^2, ntype="ra", r=25), digits=2), "\n"))
}
# Runger/Prabhu (1996), p. 1704, Tab. 1
if (FALSE) {
r <- 0.1
p <- 4
H <- 12.73
cat(paste(0, "\t", round(mewma.arl(r, H, p, delta=0, ntype="mc", r=50), digits=2), "\n"))
for ( delta in c(.5, 1, 1.5, 2, 3) )
cat(paste(delta, "\t",
round(mewma.arl(r, H, p, delta=delta, ntype="mc", r=25), digits=2), "\n"))
# compare with Fortran program (MEWMA-ARLs.f90) from Molnau et al. (2001) with m1 = m2 = 25
# H4 P R DEL ARL
# 12.73 4. 0.10 0.00 199.78
# 12.73 4. 0.10 0.50 35.05
# 12.73 4. 0.10 1.00 12.17
# 12.73 4. 0.10 1.50 7.22
# 12.73 4. 0.10 2.00 5.19
# 12.73 4. 0.10 3.00 3.42
p <- 20
H <- 37.01
cat(paste(0, "\t",
round(mewma.arl(r, H, p, delta=0, ntype="mc", r=50), digits=2), "\n"))
for ( delta in c(.5, 1, 1.5, 2, 3) )
cat(paste(delta, "\t",
round(mewma.arl(r, H, p, delta=delta, ntype="mc", r=25), digits=2), "\n"))
# compare with Fortran program (MEWMA-ARLs.f90) from Molnau et al. (2001) with m1 = m2 = 25
# H4 P R DEL ARL
# 37.01 20. 0.10 0.00 199.09
# 37.01 20. 0.10 0.50 61.62
# 37.01 20. 0.10 1.00 20.17
# 37.01 20. 0.10 1.50 11.40
# 37.01 20. 0.10 2.00 8.03
# 37.01 20. 0.10 3.00 5.18
}
# Knoth (2017), p. 85, Tab. 3, rows with p=3
if (FALSE) {
p <- 3
lambda <- 0.05
h4 <- mewma.crit(lambda, 200, p)
benchmark <- mewma.arl(lambda, h4, p, delta=1, r=50)
mc.arl <- mewma.arl(lambda, h4, p, delta=1, r=25, ntype="mc")
ra.arl <- mewma.arl(lambda, h4, p, delta=1, r=27, ntype="ra")
co.arl <- mewma.arl(lambda, h4, p, delta=1, r=12, ntype="co2")
gl3.arl <- mewma.arl(lambda, h4, p, delta=1, r=30, ntype="gl3")
gl5.arl <- mewma.arl(lambda, h4, p, delta=1, r=25, ntype="gl5")
abs( benchmark - data.frame(mc.arl, ra.arl, co.arl, gl3.arl, gl5.arl) )
}
# Prabhu/Runger (1997), p. 13, Tab. 3
if (FALSE) {
p <- 2
r <- 0.1
H <- 8.64
cat(paste(0, "\t",
round(mewma.ad(r, H, p, delta=0, type="cycl", ntype="mc", r=60), digits=2), "\n"))
for ( delta in c(.5, 1, 1.5, 2, 3) )
cat(paste(delta, "\t",
round(mewma.ad(r, H, p, delta=delta, type="cycl", ntype="mc", r=30), digits=2), "\n"))
# better accuracy
for ( delta in c(0, .5, 1, 1.5, 2, 3) )
cat(paste(delta, "\t",
round(mewma.ad(r, H, p, delta=delta^2, type="cycl", r=30), digits=2), "\n"))
}
Run the code above in your browser using DataLab