# # Written by: # -- # John L. Weatherwax 2009-04-21 # # email: wax@alum.mit.edu # # Please send comments and especially bug reports to the # above email address. # #----- save_Plots = F DN="../../WriteUp/Graphics/Chapter6/" z_acf = c(0.85,0.67,0.56,0.52,0.51,0.46,0.42,0.38,0.36,0.32) dz_acf = c(0.25,-0.25,-0.35,-0.12,0.03,0.13,0.18,0.02,-0.07,-0.1) n = 82 # For z: # if( save_Plots ){ fn=paste(paste(DN,"prob_5_z_acf",sep=""),".eps",sep="") postscript(fn, onefile=FALSE, horizontal=FALSE) } sdt = sqrt( ( 1 + 2 * sum( z_acf[1:3]^2 ) ) / n ) # an approximation ylim = c( min( c(z_acf,-sdt) ), max( c(z_acf,+sdt) ) ) plot( z_acf, ylim = ylim, main="ACF(z)" ) abline(h= 2*sdt,col=2) abline(h=-2*sdt,col=2) if( save_Plots ){ dev.off() } # For delta(z): # if( save_Plots ){ fn=paste(paste(DN,"prob_5_delta_z_acf",sep=""),".eps",sep="") postscript(fn, onefile=FALSE, horizontal=FALSE) } sdt = sqrt( ( 1 + 2 * sum( dz_acf[1:3]^2 ) ) / n ) # an approximation ylim = c( min( c(dz_acf,-sdt) ), max( c(dz_acf,+sdt) ) ) plot( dz_acf, ylim = ylim, main="ACF(Delta(z))" ) abline(h= 2*sdt,col=2) abline(h=-2*sdt,col=2) if( save_Plots ){ dev.off() }