3

I wanted to get the eigenvectors and eigenvalues out of a 3x3 matrix.

I've already tried to use the EigenvalueDecomposition from Accord. The problem(?) I have with the resulting eigenvectors is that online calculators for eigenvectors are giving me different vectors from what Accord.NET does.

More precisely, I tried Accord's EigenvalueDecomposition on this test matrix:

(1, 2, 3)

(4, 5, 6)

(7, 8, 9)

where the arndt-bruenner calculator (http://www.arndt-bruenner.de/mathe/scripts/engl_eigenwert2.htm) gives me these results:

Real Eigenvalues: { -1.1168439698070431 ; 0 ; 16.116843969807043 }

Eigenvectors:

for Eigenvalue -1.1168439698070431:

[ -0.785830238742067 ; -0.08675133925662847 ; 0.6123275602288102 ]

for Eigenvalue 0:

[ 0.4082482904638631 ; -0.8164965809277261 ; 0.4082482904638631 ]

for Eigenvalue 16.116843969807043:

[ 0.2319706872462859 ; 0.5253220933012337 ; 0.8186734993561815 ]

Now when I use this test matrix on Accords EigenvalueDecomposition, I get these results:

(0.231970687246286, 0.816964204061037, 0.408248290463863)

(0.525322093301234, 0.0901883579085377, -0.816496580927726)

(0.818673499356182, -0.636587488243964, 0.408248290463863)

The eigenvalues however are correct with the results from the online calculator.

What am I doing wrong and how do I have to use Accord's functions correctly for this?

I only did this in c#:

double[,] kovarianzmatrix = new double[,]
        {
            {1, 2, 3},
            {4, 5, 6},
            {7, 8, 9}
        };

        Accord.Math.Decompositions.EigenvalueDecomposition solver = new Accord.Math.Decompositions.EigenvalueDecomposition(kovarianzmatrix, false, true);

And printed the eigenvectors in the console.

jsanalytics
  • 13,058
  • 4
  • 22
  • 43

0 Answers0