commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrea antonello <>
Subject Re: [math] eigenvector doubts and issues
Date Mon, 11 Nov 2013 10:40:10 GMT
Hi Thomas,
thanks for your reply.

> the result of CM and jama are identical, the difference is just in the
> way how the data is stored.
> Afaik in jama calling getV() returns a vector in row format whereas in
> CM the are stored in column format.
> If you transpose the matrix (or call getVT()) you will see that the
> vectors are identical, except for the signs and order. The reason for
> this is that for CM the eigenvalues/eigenvectors are sorted in
> descending order in case of a symmetric matrix, which is the case for
> your matrix.

the problems is that the result is not just different in the
transposed way. And in fact if I pick the getVT,results are still not
the same.
The result seems to be reflected on the secondary diagonal, not the
primary diagonal.

Furthermore, if I use the API, I do not expect to be problems of rows
and columns, so if I use:

double eigenValue = eigenDecomposition.getRealEigenvalue(i);
RealVector eigenVector = eigenDecomposition.getEigenvector(i);

I expect the eigenvector and eigenvalue to be the right ones for the
given index, no matter how the results are given in the matrixes.

But the results I get are, for the same eigenvalue:
CM: eigenVal: 0.8056498828134406, eigenVect: [0.9015723557614027,
0.19005937823202243, 0.38864472217295326
JAMA: eigenVal: 0.8056498828134406, eigenVect: [-0.7731388420716028,
0.5012101463530931, -0.38864472217295326]

I am still quite puzzled about what I am missing.

> Thomas
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message