Mldivide gives rank deficency when solving for large full system

9 ビュー (過去 30 日間)
Giulio Tagliaferro
Giulio Tagliaferro 2019 年 12 月 10 日
コメント済み: Star Strider 2019 年 12 月 11 日
I have tried to solve a full linear system of approx 3 millions equation and 3 uknown.
If I try to solve the system (A\y) using mldivide i get:
Warning: Rank deficient, rank = 1, tol = 4.893629e+05.
And the results are completely wrong
However when forming the normal equation system (A'*A) x = A'*y the solver runs perfectly fine which is not surprising. (I know that in general is less numerically stable but in this case works fine)
From the documentation I read mldivide should use the QR solver on rectangular matrices. If i try to call QR on the A matrix I get:
Error using qr
Requested 3107227x3107227 (71934.3GB) array exceeds maximum array size preference.
My question are: what is mldivive trying to do? why it says that a rank deficecy is present?

回答 (1 件)

Star Strider
Star Strider 2019 年 12 月 10 日
See if the lsqr function will do what you want.
Another option is to use pinv to do the matrix inversion (not normally an approach I would recommend, however this appears to be an unusual situation).
  2 件のコメント
Giulio Tagliaferro
Giulio Tagliaferro 2019 年 12 月 11 日
Playing with tolernace and number of iteration i was able to get the correct result using lsqr.Also solving uisng pinv seem to give a resonable result. This still does not explain the behaviour of mldivide.
Star Strider
Star Strider 2019 年 12 月 11 日
This still does not explain the behaviour of mldivide.
It does, actually. See the Algorithms section of the documentation. The mldivide function can deal with some sparse matrices, although not matrices that are badly scaled or nearly singular. That is likely the reason that lsqr and the similar functions are included in the core MATLAB functions.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

製品


リリース

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by