Spectral radius of matrix?

95 ビュー (過去 30 日間)
Giovanni Barbarino
Giovanni Barbarino 2018 年 1 月 25 日
コメント済み: Joseph Moore 2022 年 6 月 8 日
In order to find the spectral radius of a matrix, I commonly use
max(abs(eig(A)))
that computes all the eigenvalues. Is there a faster way? I'm interested only on the spectral radius, and don't need anything else..

回答 (1 件)

Steven Lord
Steven Lord 2018 年 5 月 11 日
Ask the eigs function to return the largest magnitude eigenvalue.
% Generate a vector of eigenvalues suitable for the 'randcorr' option of the gallery function
x = rand(1, 100);
x = 100*x./sum(x);
% Generate a matrix whose eigenvalues are the elements of x
A = gallery('randcorr', x);
% Compute the largest magnitude eigenvalue
largest = eigs(A, 1, 'lm')
% Check: this should be small
largest - max(x)
If you're using release R2017b or later, you might want to use 'largestabs' instead of 'lm' in the eigs call. The old options are still accepted, but 'largestabs' is more descriptive of what it's doing than 'lm'.
  5 件のコメント
David Goodmanson
David Goodmanson 2018 年 5 月 12 日
編集済み: David Goodmanson 2018 年 5 月 12 日
Hi Jan,
I forgot that line. The initial n is rand(1000,1), so I addended the comment.
The code was not a serious suggestion since it does not contain a tolerance check to stop the iteration, which might have slowed it down too much. But I found that for the special case of the random matrix it takes surprisingly few iterations to get a pretty accurate result.
Joseph Moore
Joseph Moore 2022 年 6 月 8 日
eigs(X, 1, 'lm') will give negative answers

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

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by