Which algorithm does SVD function take?
Mostrar comentarios más antiguos
Hi Matlab supporter,
Could I you tell me which algorithm (algorithm name and basic description) does Matlab SVD function take for svd decomposion? (In Matlab 2020b). When I compared Matlab decomposition results with Scilab decomposition results, I find they are different, all meet SVD decomposion definition, but they have different U,V. ([U S V]=svd(A), U*S*V'=A)
Hope to get help from you.
Thank you,
Regards,
Bin
Respuesta aceptada
Más respuestas (2)
Catalytic
el 29 de En. de 2024
2 votos
Comparing results showed that max difference in S and S1 reached 1e-14, but for U and U1 or for V and V1, max difference reached 0.xxx.
We would have to see S and S1, so you might wish to attach them for us in a .mat file. If all the S(i) are distinct, as I would expect for a random matrix A, the singular vectors are unique up to a difference in sign. So, when you calculate the max difference, you should make sure you accounted for a sign flip.
If some singular values S(i) are repeated, then the singular vectors are unstable and, as @Matt J mentions, you can expect to see all kinds of numerical differences for all kinds of reasons.
3 comentarios
Bruno Luong
el 29 de En. de 2024
+1
Catalytic
el 29 de En. de 2024
@Bruno Luong I'm very pleased you consider my answer to merit +1 (but you didn't actually upvote it) :-)
Bruno Luong
el 29 de En. de 2024
I didn't because it actually does not answer the question "which algorithm", but I think you are right on on the diagnostic.
Categorías
Más información sobre Linear Algebra en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

