Wolf
08-14-2002, 03:00 AM
Hi,
I am using the svdcmp() routine (V2.10). The two bugs in this routine reported on this web site I have corrected and I read the discussion about the uniqueness of SV-decompositions.
The matricees I have to decompose are singular and some of the singular values are equal. My algorithm enforces this condition. A simple example is the following 3x3 matrix:
Matrix (3x3):
-0.988228951897092 -1.086594333683141 -1.433160736952583
-3.190200029661606 0.190459703263404 -6.475629910954768
1.400596416735888 7.158603907761226 -0.778109120408813
The singular values are (7.421974, 7.421974, 0.)
Fist question: The singular values of the matricees provided in the example xsvdcmp are nicely sorted in descendeing order. The singular values of real world matricees are not. Is svdcmp() designed to sort the singular values or not?
Second question: If a matrix has equal singular values, an orthogonal transformation may be applied to the corresponding columns. For the above case this means, that the column corresponding to the singular value sv=0. should be equal to other decompositions (up to sign). The other two columns may have different values. Comparing the columns of u and v corresponding to sv=0. returned by svdcmp(), MATHLAB and MATHEMATICA I get:
Column of u corresponding to sv=0.;
svdcmp() MATHLAB MATHEMATICA
----------------------------------------------------------
0.961016 -0.9610 -0.961016
-0.230954 0.2310 0.230954
0.152016 -0.1520 -0.152016
Column of v corresponding to sv=0.;
svdcmp() MATHLAB MATHEMATICA
----------------------------------------------------------
0.872872 0.8729 -0.872872
0.458956 -0.2182 0.218218
0.165695 -0.4364 0.436436
How can this be?
With best regards,
Frank Wolf.
I am using the svdcmp() routine (V2.10). The two bugs in this routine reported on this web site I have corrected and I read the discussion about the uniqueness of SV-decompositions.
The matricees I have to decompose are singular and some of the singular values are equal. My algorithm enforces this condition. A simple example is the following 3x3 matrix:
Matrix (3x3):
-0.988228951897092 -1.086594333683141 -1.433160736952583
-3.190200029661606 0.190459703263404 -6.475629910954768
1.400596416735888 7.158603907761226 -0.778109120408813
The singular values are (7.421974, 7.421974, 0.)
Fist question: The singular values of the matricees provided in the example xsvdcmp are nicely sorted in descendeing order. The singular values of real world matricees are not. Is svdcmp() designed to sort the singular values or not?
Second question: If a matrix has equal singular values, an orthogonal transformation may be applied to the corresponding columns. For the above case this means, that the column corresponding to the singular value sv=0. should be equal to other decompositions (up to sign). The other two columns may have different values. Comparing the columns of u and v corresponding to sv=0. returned by svdcmp(), MATHLAB and MATHEMATICA I get:
Column of u corresponding to sv=0.;
svdcmp() MATHLAB MATHEMATICA
----------------------------------------------------------
0.961016 -0.9610 -0.961016
-0.230954 0.2310 0.230954
0.152016 -0.1520 -0.152016
Column of v corresponding to sv=0.;
svdcmp() MATHLAB MATHEMATICA
----------------------------------------------------------
0.872872 0.8729 -0.872872
0.458956 -0.2182 0.218218
0.165695 -0.4364 0.436436
How can this be?
With best regards,
Frank Wolf.