I don't understand the following problem: I simulated two data sets that differ in the sign of the correlation matrix, like this:
Programming language is R.
data_neg <- data.frame(mvrnorm(n=500, mu=rep(0,2), Sigma=cbind(c(1, -0.9), c(-0.9, 1))))
data_pos <- data.frame(mvrnorm(n=500, mu=rep(0,2), Sigma=cbind(c(1, 0.9), c(0.9, 1))))
When I calculate the following eigenvalues I get similiar results.
eigen(t(as.matrix(cbind(1, data_neg)))%*%as.matrix(cbind(1, data_neg)))$values
eigen(t(as.matrix(cbind(1, data_pos)))%*%as.matrix(cbind(1, data_pos)))$values
When I do this with 4x4 correlation matrix and different sign, I also get similiar eigenvalues.
BUT when I do it with a 3x3 correlation matrix like this:
data_neg2 <- data.frame(mvrnorm(n=500, mu=rep(0,3), Sigma=cbind(c(1, -0.5, -0.5), c(-0.5, 1, -0.5),c(-0.5, -0.5, 1))))
data_pos2 <- data.frame(mvrnorm(n=500, mu=rep(0,3), Sigma=cbind(c(1, 0.5, 0.5), c(0.5, 1, 0.5),c(0.5, 0.5, 1))))
and calculate the eigenvalues of the matrix as above
eigen(t(as.matrix(cbind(1, data_neg2)))%*%as.matrix(cbind(1, data_neg2)))$values
eigen(t(as.matrix(cbind(1, data_pos2)))%*%as.matrix(cbind(1, data_pos2)))$values
I get for the data_neg2 following eigenvalues:
7.680168e+03, 7.370440e+03, 4.993057e+03, 1.455192e-11
and for data_pos2:
9518.989, 4991.912, 2598.929, 2580.389
which is totally different although I only changed the sign.
With the 2x2 and 4x4 matrix the change in the sign at the correlation matrix had no effect. Why is there this big difference with this 3x3 matrix?