Any reason why Octave, R, Numpy and LAPACK yield different SVD results on the same matrix?

泪湿孤枕 提交于 2019-12-04 03:40:20

In SVD decomposition $A=UDV^T$ only $D$ is unique (up to reordering). It is more or less easy to see that $cU$ and $\frac{1}{c}V$ will give the same decomposition. So it is not surprising that different algorithms can give different results. What matters is that $D$ must be the same for all algorithms.

Actually, the U and V are also unique for unique singular values. The reason yours are not is that singular values 2 and 3 are repeated. Singular value 1 (the 3.4) is unique - and therefore columns 1 of U and V are the same in both answers.

Also, even though columns 2 and 3 are not unique, they should lie in the same linear subspace for both answers. This means that if U1 consists of columns 2 and 3 of the first U, and U2 consists of columns 2 and 3 of the second U, then U1'*U2 should be a full rank 2x2 matrix whose columns are both of unit (euclidean) magnitude.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!