##### R-code for computing numbers in Table 5.3. ##### It needs to use the R-package spc which should ##### be installed beforehand. ### Computation for the one-sided EWMA chart ### la=seq(0.48,0.5,0.001) rho=rep(0,length(la)) for(i in 1:length(la)){ rho[i]=xewma.crit(l=la[i],L0=200) } arl1=rep(0,length(la)) for(i in 1:length(la)){ arl1[i]=xewma.arl(l=la[i],c=rho[i],mu=2.0) } ### Computation for the one-sided CUSUM chart ### delta = seq(0.1,2.0,0.1) kk = delta/2 hh = rep(0,length(kk)) for(i in 1:length(kk)){ hh[i]=xcusum.crit(k=kk[i],L0=200) } arl2=rep(0,length(kk)) for(i in 1:length(kk)){ arl2[i]=xcusum.arl(k=kk[i],h=hh[i],mu=delta[i]) }