How to get the numerical rank of the matrix in matlab?

14 ビュー (過去 30 日間)
Jiapeng
Jiapeng 2022 年 11 月 22 日
コメント済み: Bjorn Gustavsson 2022 年 11 月 22 日
Suppose there exists a 3*3 matrix A. I know I can use rank(A) to get the rank of A. However, if there exists ε>0, how should I use matlab to get the numerical rank, should I use sprank(A)?
  1 件のコメント
Jan
Jan 2022 年 11 月 22 日
"However, if there exists ε>0, how should I use matlab" - this is not meaningful. sprank works for sparse matrices.
Use rank().

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

採用された回答

Bjorn Gustavsson
Bjorn Gustavsson 2022 年 11 月 22 日
If you can afford it you might consider looking at the singular vaules that you obtain from the svd of your A-matrix. That will allow you to judge how many singular values are sufficiently larger than ϵ or not too small compared to the larges singular value. That's how I judge how much information I can extract from a system of equations - if I can afford/manage the svd.

その他の回答 (1 件)

John D'Errico
John D'Errico 2022 年 11 月 22 日
To compute the numerical rank of a matrix, use rank. Surely that seems logical. And you even know about rank.
Bu then you seem to be askign about what if you have a tolerance. But then surely, you should have read the help for rank! Rank accepts a tolerance as an option. So, while you COULD use svd, looking at the singular values, and comparing them carefully to your tolerance and how that all combines with the maximum singular vlaue, all you needed to use is rank in the first place. It already does the work for you, including alllowing you to provide a tolerance. (You do NOT just compare the small singular value to an absolute tolerance, as the largest singular value is hugely important here.)
help rank
RANK Matrix rank. RANK(A) provides an estimate of the number of linearly independent rows or columns of a matrix A. RANK(A,TOL) is the number of singular values of A that are larger than TOL. By default, TOL = max(size(A)) * eps(norm(A)). Class support for input A: float: double, single Documentation for rank doc rank Other uses of rank distributed/rank sym/rank symbolic/rank
  1 件のコメント
Bjorn Gustavsson
Bjorn Gustavsson 2022 年 11 月 22 日
The justification for doing the svd is (in my mind) that that's how one typically should go about solving illposed mixed-determined problems with Tikhonov-requlatization (second-order if I can chose) anyway, then one always look at the singular-values, the Picard-condition and have a think about how noise will effect the choise of regularization-parameter. In my problems with a couple of 1000s unknowns it doesn't matter much if the rank of my measurement matrix is 4500 or 4400 - that will be floating with the noise-level between different RHS (data) of the problem.
Your answer is obviously the litterally correct one.

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

カテゴリ

Help Center および File ExchangeSparse Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by