SVDS fails to find the requested number of singular values

조회 수: 3 (최근 30일)
David Russell
David Russell 2018년 2월 7일
답변: Christine Tobler 2018년 2월 8일
I have a large, sparse matrix P whose 2nd-6th singular values are very close together. When I call svds(P, n) for n = 1 through 4, I only get one singular value, i.e. S is a 1X1 matrix. But for n > 4 I get n singular values. For example, for n = 10, I get the following singular values:
0.999983033171519
0.977304152905677
0.977303005303906
0.977301775263024
0.977291373746100
0.977282929457516
0.973261074205161
0.952652676911938
0.952651480387276
0.952646797642832
I'd love to know what's going on here, and if there is a way to anticipate or correct for the case when the number of found singular values is deficient. I'm using MATLAB 2015b and I've attached the matrix in question.

채택된 답변

Christine Tobler
Christine Tobler 2018년 2월 8일
The algorithm used in SVDS was rewritten for R2016a (and Name-Value pairs such as 'SubspaceDimension' were added in R2017b - they correspond to fields in the options structure in the older syntaxes).
In R2015b, the best thing to do would be to check the length of the output vector, and in case it is too short, increase the requested number of singular values (this implicitly increases the 'SubspaceDimension' used in the internal algorithm).
In R2016a and later, n singular values are always returned, but there is a warning that the iteration did not converge. The algorithm can be made to converge by setting 'SubspaceDimension'. In MATLAB R2016a-R2017a, the command 'SubspaceDimension' is set using the 'p' field in the options structure: svds(P, n, 'largest', struct('p', 60)).
The reason that this problem is hard to solve is that the 7 largest singular values are very close together for this matrix.

추가 답변 (1개)

Matt J
Matt J 2018년 2월 8일
편집: Matt J 2018년 2월 8일
The documentation says to try increasing the SubspaceDimension parameter. This seems to work with your matrix,
>> svds(P,4,'largest','SubspaceDimension',60)
ans =
0.999983033171520
0.977304152905677
0.977303005303906
0.977301775263023

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by