################################################################## # # EXCHANGE RATE DATA # West & Harrison (1997, 16.4.6 Application to exchange # rate modelling, pages 612-615). # Series: # US Dollar # Canadian Dollar # Japanese Yen # French Franc # Italian Lira and Deutschmark. # # Periodicity: Monthly data from January 1971 to December 1986. # ################################################################## names = c("US Dollar","Canadian Dollar","Japanese Yen", "French Franc","Italian Lira","Deutschmark") n = 144 p = 6 y = matrix(scan("exchangerate-monthly.txt"),n,p,byrow=T) pdf(file="exrate.pdf",width=9,height=5) par(mfrow=c(2,3)) for (i in 1:p){ plot(y[,i],xlab="months",ylab="",main=names[i],axes=F,type="l") axis(2) axis(1,at=seq(1,n,by=12),label=1975:1986) } dev.off() r = exp(apply(log(y),2,diff))-1 pdf(file="exrate-return.pdf",width=9,height=5) par(mfrow=c(2,3)) for (i in 1:p){ plot(r[,i],xlab="months",ylab="",main=names[i], axes=F,type="l",ylim=range(r)) axis(2) axis(1,at=seq(12,n-1,by=12),label=1976:1986) abline(h=0,col=2) } dev.off() round(cor(y),2) round(cov(y),3) [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1.00 0.86 0.80 -0.45 -0.50 0.62 [2,] 0.86 1.00 0.43 -0.14 -0.07 0.29 [3,] 0.80 0.43 1.00 -0.45 -0.65 0.87 [4,] -0.45 -0.14 -0.45 1.00 0.92 -0.11 [5,] -0.50 -0.07 -0.65 0.92 1.00 -0.38 [6,] 0.62 0.29 0.87 -0.11 -0.38 1.00 [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.119 0.098 31.076 -0.199 -65.349 0.122 [2,] 0.098 0.110 16.037 -0.061 -9.395 0.056 [3,] 31.076 16.037 12678.481 -63.930 -27804.494 56.056 [4,] -0.199 -0.061 -63.930 1.624 444.863 -0.078 [5,] -65.349 -9.395 -27804.494 444.863 143476.615 -82.633 [6,] 0.122 0.056 56.056 -0.078 -82.633 0.327 fac2 = factanal(y,2,"mle",score="regression") fac2$loadings Factor1 Factor2 [1,] 0.938 -0.341 [2,] 0.946 0.093 [3,] 0.650 -0.546 [4,] -0.156 0.908 [5,] -0.177 0.982 [6,] 0.548 -0.289 fac2$uniq [1] 0.00500000 0.09543247 0.28028025 0.15210142 0.00500000 [6] 0.61608539 fac2$loadings^2