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

조회 수: 12 (최근 30일)
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!

채택된 답변

Bruno Luong
Bruno Luong 2021년 4월 9일
편집: Bruno Luong 2021년 4월 9일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Eigenvalues에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by