If I'm using a programming language which uses a covariance matrix to find the eigenvectors and eigenvalues, how do you know which is the first eigenvector of the covariance matrix?

For example, suppose the following eigenvalues are returned,

0.1017         0         0         0
     0    4.1704         0         0
     0         0    7.2938         0
     0         0         0   23.8721

and suppose the corresponding eigenvectors are

     .9032         .28394        .3242        -.453
     .343         -.23423       -.234234       .2342
    -.3423         .76940        .2938         .7584
     .76859        .9873         .3242        -.8721

I thought I read somewhere that it's convention to make the first eigenvalue be the one with the largest value. Is this correct? If so, then because the fourth column has the largest corresponding eigenvalue, then the fourth column would actually be the first egienvector? Or do you just take the first column to be the first eigenvector?


When writing on paper, yes, you may arrange the eigenvalues at a decreasing order. For Matlab, though, the eigenvectors correspond to the "coordinate arrangement" yielded for the eigenvalues by the matrix of them.

  • $\begingroup$ So to be clear, since I'm using Matlab, the first eignvector is just the first column, regardless of the corresponding eigenvalues? $\endgroup$ – user6259845 Nov 26 '18 at 7:17
  • $\begingroup$ No, the first eigenvalue corresponds to the first eigenvector per Matlab order and so on. What I said, is that eigenvalues and eigenvectors aren't differently ordered and/or decrrasinglly ordered. Eigenvalues and Eigenvectors MUST come in corresponding pairs to make sense (recall the diagonalization theorems). $\endgroup$ – Rebellos Nov 26 '18 at 7:23
  • $\begingroup$ That makes sense, thanks! $\endgroup$ – user6259845 Nov 26 '18 at 7:24
  • $\begingroup$ No problem, glad I could help! If the answer was helpful you may use the votes buttons! $\endgroup$ – Rebellos Nov 26 '18 at 7:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.