70 likes | 151 Views
postscript(file="sales.eps",paper="letter") x<-BJsales.lead;y<-BJsales par(mfrow=c(2,1)) plot(y,type="l",main="Sales",las=1) plot(x,type="l",main="Leading series",las=1) plot(diff(y),type="l",main="Difference sales",las=1) plot(diff(x),type="l",main="Difference leading series",las=1)
E N D
postscript(file="sales.eps",paper="letter") x<-BJsales.lead;y<-BJsales par(mfrow=c(2,1)) plot(y,type="l",main="Sales",las=1) plot(x,type="l",main="Leading series",las=1) plot(diff(y),type="l",main="Difference sales",las=1) plot(diff(x),type="l",main="Difference leading series",las=1) graphics.off()
postscript(file="sales1.eps",hor=F,paper="letter") acf(cbind(x,y),main="sales and leader") acf(cbind(diff(x),diff(y)),main="diff(sales) and diff(lead)") par(mfrow=c(3,1)) junk<-spec.pgram(cbind(diff(x),diff(y)),spans=5,taper=0,demean=T,detrend=F,xlab="",ylab="",main="Smoothed spec of diffs - red is sales") plot(junk$freq,junk$coh,type="l",las=1,main="Squared coherency",ylim=c(0,1),xlab="") plot(junk$freq,junk$phase,type="l",las=1,main="Phases",ylim=c(-pi,pi),xlab="") graphics.off()