Ch2- 4 - Johnson
Purpose - Testing for equality of covariance matrices
Consider again the monthly log returns of the CRSP ten decile indices. Divide the sample into two subperiods with period 1 being from January 2000 to December 2004.
Test the equality of cov matrices
> folder <- "C:/Cauldron/Books/Statistics/Multivariate/TSAY/" > x <- read.table(paste(folder, "m-dec0009.txt", sep = ""), header = T) > x1 <- x[1:which(x[, 1] == 20041231), ] > x2 <- x[(which(x[, 1] == 20041231) + 1):dim(x)[1], ] > x1 <- x1[, -1] > x2 <- x2[, -1] > x1 <- log(1 + x1) > x2 <- log(1 + x2) > x <- read.table(paste(folder, "m-dec0009.txt", sep = ""), header = T) > x <- x[, -1] > x <- log(1 + x) |
> source(paste(folder, "Box_M.R", sep = "")) > Box_M(x, c(60, 60)) [1] "Test result:" [,1] Box.M-C 1.673949e+02 p.value 2.787770e-13 |
Equivalence of cov matrix is rejected.
> source(paste(folder, "Behrens.R", sep = "")) > Behrens(x1, x2) [1] "Estimate of v: " [1] 109.3674 [1] "Test result:" [,1] Test-T2 9.709 p.value 0.544 |