svds(X,r) and svd(X,'econ') generating different singular vectors for large complex matrix X ??

12 visualizzazioni (ultimi 30 giorni)
Hi,
I was trying to calculate truncated svd for a large complex matrix X. I noticed that svds(X,r) and svd(X,'econ') seemingly generate different U and V matrices, although the singular values are the same. For example,
A = randn(50,20) + 1i*randn(50,20);
[U,S,V] = svd(A,'econ');
[Ur,Sr,Vr] = svds(A,2);
U(1:4,1:2)
Ur(1:4,1:2)
S(1:2,1:2)
Sr(1:2,1:2)
But when X is small or real, two commands give the same results. For example,
A = randn(50,20);
[U,S,V] = svd(A,'econ');
[Ur,Sr,Vr] = svds(A,2);
U(1:4,1:2)
Ur(1:4,1:2)
S(1:2,1:2)
Sr(1:2,1:2)
Or,
A = randn(10,5) + 1i*randn(10,5);
[U,S,V] = svd(A,'econ');
[Ur,Sr,Vr] = svds(A,2);
U(1:4,1:2)
Ur(1:4,1:2)
S(1:2,1:2)
Sr(1:2,1:2)
Did I misunderstand something? Thanks in advance!

Risposta accettata

Bruno Luong
Bruno Luong il 9 Apr 2021
Modificato: Bruno Luong il 9 Apr 2021
The singular value (eigen) decomposition SVD/SVDS is not unique, vectors is up to scaling, (values is up to order for eigen value decomposition - EIG/EIGS), and I'm not talking about multiple singular/eigen values (order > 1).
If you do
U(:,1:2)./Ur(:,1:2)
abs(U(:,1:2)./Ur(:,1:2))
after your code, you can clearly observe they are just proportonal by a unit complex scaling.

Più risposte (0)

Categorie

Scopri di più su Eigenvalues in Help Center e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by