Description Usage Arguments Details Value Author(s) Examples
Computes the norm of a vector with size adjustment.
1 |
x |
A numeric vector. |
norm |
The type of norm. See details. |
This function calculates the norm of a vector. It is slightly different from the
ordinary norm function in that L1
-norm and L2
-norm are adjusted by the length
of vector, n. To be specific, define a vector x = (x_1,x_2,...,x_n).
The L1
-norm is defined as
||x||_1 = (|x_1| + |x_2| + ... + |x_n|)/n.
The L2
-norm is defined as
||x||_2 = (√{(x_1)^2 + (x_2)^2 + ... + (x_n)^2)/n.}
The Linf
-norm is defined as
||x||_{∞} = \max(|x_1|,|x_2|,...,|x_n|).
Note that a matrix X
will be coerced to a vector.
A non-negative number.
Debin Qiu, Jeongyoun Ahn
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.