This project has moved. For the latest updates, please go here.

Return order of Eigenvalues and Eigenvectors

Apr 9, 2012 at 12:36 AM
Edited Apr 9, 2012 at 12:36 AM

Hi everyone,

I'm sorry if this question sounds weird, but here goes. I'm trying to compute the eigenvalue decomposition of a covariance matrix for 3 random variables. I was trying to plot the deviation of only the first two values, so I computed the Evd() of the matrix, hoping to use the eigenvectors and values to build a graphical representation.

However, my problem is that the order of the returned eigenvectors and values seems to be random and bears no direct relationship to the order of the variables represented in the covariance matrix (it changes with different calls even for very similar matrices). I know that mathematically the order doesn't matter, but how would you go about solving this problem? I've checked that MATLAB for instance seems to sort the eigenvectors and values in this "natural" order.

Is there anything I'm missing?

Thanks in advance for all the help.