# Eigenvectors a la Numerical Recipes - Jacobi

This topic is 4322 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi All, I am having wierd issues with trying to find the eigenvectors of symmetric matrices. I am basically ripping off the numerical recipes (in C) jacobi method of rotating matrixes until an exit condition is reached. According to the book, this method is *foolproof* for real, symmetric matrices. However some input matrices give me non-orthogonal eigenvectors! I have checked against an online matrix calculator which gives me exactly the same results I have. I am working in 3 dimensions, and passing in the covariance matrix of some geometry, so physically the idea of getting back 3 orthgonal eigenvectors makes perfect sense. As I said though, I'm getting some back that have two vectors that aren't orthogonal. I was hoping someone might have an idea how this might happen? As an example, here is a covariance matrix and its (ok) set of eigenvectors (vectors are in columns of the Eigenvector matrix): covariance matrix is: 477.182012 -0.000000 -282.436317 -0.000000 1115.303953 -0.000000 -282.436317 -0.000000 1696.144071 Eigenvalues are: 414.920979 1115.303953 1758.405104 Eigenvector matrix: 0.976554 0.000000 -0.215274 0.000000 1.000000 0.000000 0.215274 0.000000 0.976554 This matrix though (looks symmetric to me!) covariance matrix is: 10349.858055 -14.755129 -143.658537 -14.755129 1115.627792 -0.929152 -143.658537 -0.929152 78.885017 Eigenvalues are: 10351.890518 1115.605508 76.874839 Eigenvector matrix: 0.999901 0.001581 0.013984 -0.001596 0.999998 0.001093 -0.013983 -0.001115 0.999902 A quick check shows that the last matrix contains two non-orthogonal vectors. Any ideas? This is wierding me out!

##### Share on other sites
Are you sure? My calculator tells me that the determinants of both your eigenvector matrices are 1.0 to within 6 decimal places. And since your eigenvectors are normalized, this of course implies that your vectors are also orthogonal. Any error would be due to accumulation of floating-point inaccuracy.

##### Share on other sites
whoops - my orthogonality check was wrong. I am still having an issue when I plot the results visually, but it looks as though the unit vectors I'm getting are ok.

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633705
• Total Posts
3013462
×