I have a 6000*6000 symmetric matrix and all entries are positive. I use eig function of matlab to decompose its eigenvalues&eigenvectors. But there are negative eigenvalues in results. Where do you think is the problem?
Thanks. Sevil.
I have a 6000*6000 symmetric matrix and all entries are positive. I use eig function of matlab to decompose its eigenvalues&eigenvectors. But there are negative eigenvalues in results. Where do you think is the problem?
Thanks. Sevil.
There is no problem. Just because a matrix is symmetric and has all positive values doesn't guarantee positive eigenvalues. For example, try the following symmetric matrix with all positive values [3 4; 4 3]
. Performing eig([3 4; 4 3])
produces the eigenvalues of -1 and 7 and so one of the two eigenvalues is negative.
Take note that a matrix with all positive values and is symmetric is different from a matrix that is positive definite. Matrices that are positive definite have all positive eigenvalues which I believe is where you are confused. All in all, symmetric matrices that have all positive values are not necessarily positive definite matrices as you can clearly see in the example I gave above.