day<-T1/23400 mub<-read.table("/usr/users/zeng/thesis/Fortran/gbm/s9403a/rs1/ed1/MUb.dat", col.names=c("bmu","smu")) attach(mub) u2mu<-bmu+2*smu l2mu<-bmu-2*smu summary(u2mu) summary(l2mu) sgb<-read.table("/usr/users/zeng/thesis/Fortran/gbm/s9403a/rs1/ed1/SGb.dat", col.names=c("bsg","ssg")) attach(sgb) u2sg<-bsg+2*ssg l2sg<-bsg-2*ssg rob<-read.table("/usr/users/zeng/thesis/Fortran/gbm/s9403a/rs1/ed1/ROb.dat", col.names=c("bro","sro")) attach(rob) u2ro<-bro+2*sro l2ro<-bro-2*sro postscript("BEp.ps", he=9,wi=6, ho=F,pointsize=10) par(las=1,mar=c(6.1,8.2,3,1.3),mgp=c(4.2,0.5,0), mfrow=c(3,1)) plot(day,bmu,type="l", ylim=c(-6e-07, 12e-07),ylab="MU", xlab="Day") lines(day,u2mu,lty=2,col="blue") lines(day,l2mu,lty=5,col="blue") abline(h=4.40e-08,lty=4,col="red") title("Bayesian estimates of MU and their two-SDs Bounds") #axis(2,at=c(5e-8)) legend(17,12e-7,c("bayesian estimates", "upper 2-SD bound","lower 2-SD bound","true mu"),lty=c(1,2,5,4)) plot(day,bsg,type="l", ylim=c(1.0e-4,1.45e-4),ylab="SIGMA", xlab="Day") lines(day,u2sg,lty=2,col="blue") lines(day,l2sg,lty=5,col="blue") abline(h=1.2e-4,lty=4,col="red") title("Bayesian estimates of SIGMA and their two-SDs Bounds") #axis(2,at=c(5e-8)) legend(17,1.45e-4,c("bayesian estimates", "upper 2-SD bound","lower 2-SD bound","true sigma"),lty=c(1,2,5,4)) plot(day,bro,type="l", ylim=c(0.18,0.24),ylab="RHO", xlab="Day") lines(day,u2ro,lty=2,col="blue") lines(day,l2ro,lty=5,col="blue") abline(h=.20,lty=4,col="red") title("Bayesian estimates of RHO and their two-SDs Bounds") #axis(2,at=c(5e-8)) legend(17,0.24,c("bayesian estimates", "upper 2-SD bound","lower 2-SD bound","true rho"),lty=c(1,2,5,4)) graphics.off() Xb<-read.table("/usr/users/zeng/thesis/Fortran/gbm/s9403a/rs1/ed1/Xb.dat", col.names=c("bX","sX")) attach(Xb) u2X<-bX+2*sX l2X<-bX-2*sX summary(u2X) summary(l2X) bXaa<-bX[32401:32500] u2Xaa<-u2X[32401:32500] l2Xaa<-l2X[32401:32500] Xaa<-X[32401:32500] dayaa<-day[32401:32500] postscript("Xp.ps", he=9,wi=6, ho=F,pointsize=10) par(las=1,mar=c(3.1,3.2,3,1.3),mgp=c(2.2,0.5,0),mfrow=c(2,1)) plot(day,bX,type="l", ylim=c(81,91),ylab="value", xlab="Day") lines(day,u2X,lty=2,col="blue") lines(day,l2X,lty=5,col="blue") lines(day,X,lty=4,col="red") title("Bayesian estimates of X(t) and their two-SDs Bounds") #axis(2,at=c(5e-8)) legend(0,91,c("bayesian estimates", "upper 2-SD bound","lower 2-SD bound","true X(t)"),lty=c(1,2,5,4)) plot(dayaa,bXaa,type="l", ylim=c(86,87.7),ylab="value", xlab="Day") lines(dayaa,u2Xaa,lty=2,col="blue") lines(dayaa,l2Xaa,lty=5,col="blue") lines(dayaa,Xaa,lty=4,col="red") title("Bayesian estimates of X(t) and their two-SDs Bounds for last 100 trades") #aXaais(2,at=c(5e-8)) legend(22.91,87.7,c("bayesian estimates", "upper 2-SD bound","lower 2-SD bound","true X(t)"),lty=c(1,2,5,4)) graphics.off() postscript("SG1.ps",he=3,wi=6, ho=F,pointsize=9) par(las=1,mar=c(6.1,8.2,3,1.3),mgp=c(4.2,0.5,0)) plot(day,bsg,type="l", ylim=c(1.0e-4,1.45e-4),ylab="SIGMA", xlab="Day") lines(day,u2sg,lty=2,col="blue") lines(day,l2sg,lty=5,col="green") abline(h=1.2e-4,lty=4,col="red") title("Bayesian estimates of SIGMA and their two-SDs Bounds") legend(4.8,1.45e-4,c("bayesian estimates","true sigma"),lty=c(1,4)) legend(15,1.45e-4,c("upper 2-SD bound","lower 2-SD bound"),lty=c(2,5)) graphics.off() #rm(day,mub,u2mu,l2mu,sgb,u2sg,l2sg,rob,u2ro,l2ro,Xb,u2X,l2X,bXaa,u2Xaa,l2Xaa,Xaa,dayaa)