Fastest way to compute spectral norm of a matrix?

조회 수: 64 (최근 30일)
Michael
Michael 2013년 6월 11일
Hello
I can't find any mention of the spectral norm in the documentation. I want to calculate
max(|Ax|)/x for any vector x, given a matrix A.
There's a method via the eigenvalues of A'A but that sounds very memory intensive, I was wondering if anyone knows a faster in-built option.
Thanks
Mike

채택된 답변

Matt J
Matt J 2013년 6월 11일
See the NORM command. It accepts matrix inputs.
  댓글 수: 3
Matt J
Matt J 2013년 6월 11일
편집: Matt J 2013년 6월 11일
Yes. Try it:
>> A=rand(5);
>> max(sqrt(eig(A.'*A)))
ans =
2.2584
>> norm(A)
ans =
2.2584
Matt J
Matt J 2013년 6월 11일
편집: Matt J 2013년 6월 11일
Hmmm. Looks like NORM is not as fast as the direct calculation,
A=rand(1000);
tic;
n1=sqrt( max( eig(A.'*A) ) );
toc; %Elapsed time is 0.150860 seconds.
tic;
n2=norm(A);
toc; %Elapsed time is 0.319899 seconds.
However, I'm pretty sure it's because NORM uses SVD instead of EIG, which is probably more numerically stable.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by