Posted Thursday, June 26, 2008 9:27 AM
|
|
|
|
Hi,
We originally used your COM version of the DLL but also purchased the .NET dll too (version 2.5). We have only just got around to implementing this in our main program and i am getting some strange results (both with eigenvalue decomposition and SVD)
I have uploaded an excel file containing the data in question. it is a correlation matrix and has 6 rows and 6 columns
the e-values returned are not in order
1.567060393
0.408506329
1.250511663
1.052965562
0.887406854
0.833549199
My concern is that performing SVD instead of eigenvalue decomposition gives the same as above when the S part of SVD is calculated.
I have attached the eigenvectors as well that were returned.
The code works fine with other datasets but not this one and really i need to find out why. Are the evalues just in a different order for some reason? Do they still marry up with the eigenvectors? (ie if i re-order the eigenvalues in descending order, will i need to re-order the vectors as well?)
|
|
Posted Thursday, June 26, 2008 11:45 AM
|
|
|
|
| .NET Matrix Library does not sort eigenvalues whereas Matrix ActiveX component does. In both cases the order of eigenvalues corresponds to the the order of eigenvalues. You may confirm this by using the basic equation: A*v = λ*v
Trifon Triantafillidis | Lead Developer |
|
|
|
Posted Friday, June 27, 2008 8:26 AM
|
|
|
|
I wasn't sure if it was something like that. However, the S part of SVD returns the same and in the help it says these should be returned in descending order?
The Singular Value Decomposition (SVD) of a mxn matrix A is written A = U*S*VH where S is an nxn (mxn if m
The diagonal elements of S are the singular values of A; they are real and non-negative, and are returned in descending order.
The first min(m,n) columns of U and V are the left and right singular vectors of A.
|
|
Posted Friday, June 27, 2008 10:13 AM
|
|
|
|
Yes, in both products the singular values (those returned by SVD) are returned ordered.
Trifon Triantafillidis | Lead Developer |
|
|
|
Posted Friday, June 27, 2008 10:37 AM
|
|
|
|
Ah yes i've got it working perfectly now. This was partly due to me not knowing the eigenvalues were not returned in the same way as the ActiveX component and also i had an additional error in my code cos when i thought i was looking at the S part of SVD, i was still looking at the eigenvalues.
Thanks for your quick response!
Also we have just purchased version 4.1 of the .NET component today and are very impressed with the extra speed enhancements!
|
|
|
|