MATLAB: For what kind of norm is this code

norm

A = randi(10,10);
norm = sqrt(sum(sum(A.*conj(A))) / prod(size(A)));

Best Answer

Fred
Following common norms
1.
Euclidean norm:
the length of a 1D vector, understanding by length the distance to the coordinates origin.
a=randi(10,1,10)
norm(a)
for an NxM matrix
norm(A)
returns the largest singular value of A
A=randi(10,3,3)
A =
9 10 8
10 1 6
1 7 9
norm(A)
ans =
20.913376670878026
[U,S,V]=svd(A)
U =
-0.739646426689545 0.049232501991144 -0.671192464374475
-0.476728914605305 -0.742280226083208 0.470902970839120
-0.475029162751758 0.668278554731149 0.572495474062294
S =
20.913376670878026 0 0
0 7.953747324398639 0
0 0 3.516899162841603
V =
-0.568972497185512 -0.793516682233532 -0.215873973566917
-0.535465768966753 0.556718047022076 -0.635091667702206
-0.624136770036285 0.245756568858319 0.741658277882517
2.
L1-norm
is sum(abs(A)) of each element,
norm(A,1)
3.
natural norm, aka induced norm, aka subordinate norm, relative to vector reference z with z=1): |A| = max(norm(A*z))
4.
L2 norm
is like the one you asked for but without normalising factor that you bapply the division by prod(size(A))
norm(A)
5.
L-infinite norm
max of L1, the largest abs() of all results obtained with L1 norm max(abs(x))
norm(A,Inf)
or
norm(A,-Inf)
returns min(abs(A))
6.
supremum norm
7.
Hardy norm
8.
quaternion norm
9.
Frobenius norm:
norm(A,'fro')
returns sqrt(sum(diag(X'*X)))
So,
from
norm: A quantity that describes the length, size, or extent of a mathematical object.
at this point may I ask what is exactly that you are attempting to measure and therefore compare?
By pondering each element of the sum, you are somehow attempting to normalise the result, yet because you do not normalise with the actual norm, such normalising attempt may not work.
It may resemble a probability distribution, what you want to build, but again, it should be done in a different way.
Fred,
Let me close this first round by asking if you find this answer useful would you please be so kind to mark my answer as Accepted Answer?
To any other reader, please if you find this answer of any help solving your question,
please click on the thumbs-up vote link,
thanks in advance
John BG