An eigen decomposition problem in programming

Asuralm
Messages
35
Reaction score
0
Hi all:

I have a covariance matrix which is like:

0.00166713 -0.00060678 4.60534e-05
-0.00060678 0.00178576 -0.000244526
4.60534e-05 -0.000244526 0.000772057

And then I want to eigen decompose the matrix to obtain the eigenvector matrix. I tried several methods, one is to use the LaEigSolve in the lapack++ library. This gives me the result:

0.655504 -0.742432 0.138237
-0.743371 -0.60208 0.291375
0.133097 0.293759 0.946568

Then I tried to use svdcmp routine of the Numerical recipe which gives me:

-0.655504 0.742432 0.138237
0.743371 0.60208 0.291375
-0.133097 -0.293759 0.946568

I also tried to use eig() in MATLAB which gives me:

-0.6555 0.7424 0.1383
0.7434 0.6021 0.2914
-0.1331 -0.2938 0.9465

By using pcacov(), the result is:

-0.6555 -0.7424 0.1383
0.7434 -0.6021 0.2914
-0.1331 0.2938 0.9465

Actually, I am writing a program of Pinciple Component Analysis in C++. But I don't really know which one is reliable and correct. The pcacov() seems to give me the correct result but I really don't understand why it's different from the others.

Can anyone help me with it please?

Thanks
 
Mathematics news on Phys.org
reconstruct the original matrix let say Ahat by using your decomposed matrices, and compute the norm of |A-Ahat|. Then decide for yourself. Do this in a for loop for a couple of hundred matrices of course...
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Thread 'Imaginary Pythagorus'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...

Similar threads

Back
Top