Sparsest solution for A\B
古いコメントを表示
Matlab says the command A\B finds a solution to Ax=B which has the smallest number of non-zero components. If A is nxm with n>m the system does not have an exact solution, in general, so A\B returns an approximate solution.
My problem is this: I have a system for which I know that a very sparse solution x0 should exist. However, A\B is not returning that solution. I imagine this can only be because Matlab finds a different solution x which is a "better" approximation in the sense that norm(Ax-B) < norm(Ax0-B).
I would like to "trade" the quality in the approximation for the sparsity in the solution. Namely, I want A\B to return the "worse" solution x0 instead of x, because x0 is more sparse than x. Is this possible?
1 件のコメント
Alex Mcaulley
2019 年 5 月 14 日
The Matlab documentation says (comparing pinv and \ function)
x = pinv(A)*b
and
y = A\b
These two are distinguished by the facts that norm(x) is smaller than the norm of any other solution and that y has the fewest possible nonzero components.
Then, you should obtain using "\" the sparsest solution. Are you sure that there is another x sparser than the one obtained with "\"?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Linear Least Squares についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!