sparsesvd icon indicating copy to clipboard operation
sparsesvd copied to clipboard

sparsesvd of an identity matrix is totally messed up

Open pmadhyastha opened this issue 12 years ago • 1 comments

Sparsesvd somehow gives a random solution to an svd of an identity matrix. Is there a reason for this?

pmadhyastha avatar Feb 09 '13 15:02 pmadhyastha

I just checked and confirmed -- the singular values are ok, but left/right singular vectors are complete rubbish.

Actually, the issue seems to be not just with identity matrix, but any matrix that has multiple identical singular values (algebraic multiplicity).

For example, the 10x10 identity matrix has ten singular values, all 1.0. This throws off SVDLIBC (the library wrapped by sparsesvd).

A "proper" fix will take time (=either modifying SVDLIBC, or post-processing its output). A faster fix is to use more interesting input, if possible -- multiple identical singular values don't happen as often in real-world data.

piskvorky avatar Feb 09 '13 20:02 piskvorky