Re: [R] eigenvalues and correlation matrices

2011-05-27 Thread dM/
Thanks Sarah. Silly mistake. I wrote the syntax when testing the correlation matrix, hence the symmetric = TRUE statement. I then thought, hang on a minute; I better check that and forgot to unwind the condition. At least I'm not going mad! On May 27, 8:40 pm, Sarah Goslee wrote: > Hi, > > Ho

Re: [R] eigenvalues and correlation matrices

2011-05-27 Thread Sarah Goslee
Hi, How about because of this: > #calculate the eigenvalues > eigen(testmatrix,symmetric = TRUE,only.value=TRUE) Your matrix isn't symmetric. If you claim that it is, R discards the upper triangle without checking. You really want this: > testmatrix <- matrix(c(2, 1, 1, 1, 3, 2, -1, 1, 2), byro

[R] eigenvalues and correlation matrices

2011-05-27 Thread dM/
I'm trying to test if a correlation matrix is positive semidefinite. My understanding is that a matrix is positive semidefinite if it is Hermitian and all its eigenvalues are positive. The values in my correlation matrix are real and the layout means that it is symmetric. This seems to satisfy th