L2 norm or Frobenius norm?

조회 수: 336 (최근 30일)
Xiaohan Du
Xiaohan Du 2018년 8월 31일
답변: Christine Tobler 2018년 9월 18일
Hi all,
I read that Matlab norm(x, 2) gives the 2-norm of matrix x, is this the L2 norm of x? Some people say L2 norm is square root of sum of element square of x, but in Matlab norm(x, 2) gives max singular value of x, while norm(x, 'fro') gives square root of sum element square.
If I want to do |x|||_2^2, should I use (norm(x, 2))^2 or (norm(x, 'fro'))^2?
Many thanks!
  댓글 수: 1
Adam
Adam 2018년 8월 31일
doc norm
gives the maths of each of the options.

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

답변 (2개)

Christine Tobler
Christine Tobler 2018년 9월 18일
The L2-norm of a matrix, |A|||_2, ( norm(A, 2) in MATLAB) is an operator norm, which is computed as max(svd(A)).
For a vector x, the norm |x|||_2, ( norm(x, 2) in MATLAB), is a vector norm, defined as sqrt(sum(x.^2)).
The Frobenius norm |A|||_F, ( norm(A, 'fro') in MATLAB), is equivalent to a vector norm applied to all elements of the matrix A. This is identical to norm(A(:), 2).
See the Wikipedia page on matrix norms for more information.
By the way, if the matrix A is of size 1-by-n or n-by-1, the matrix norm and vector norm interpretations give the same result (max(svd(x)) is identical to sqrt(sum(x.^2))).

Yuvaraj Venkataswamy
Yuvaraj Venkataswamy 2018년 8월 31일
Use 'fro' to estimate the Frobenius norm of a matrix, which estimates the 2-norm of the matrix.
if true
x=your_matrix;
n = norm(x,'fro');
end

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by