l_p_norm {amp}R Documentation

A function used to calculate various L_p norms

Description

A function used to calculate various L_p norms

Usage

l_p_norm(x, p = "max", type = "lp")

Arguments

x

Observed data

p

index of the norm

type

Kind of norm used (currently only lp and sum of squares norms are supported)

Value

The norm of x, of type type of index p. For example, the euclidean norm x has p = 2, type = "lp"

Examples

x <- c(3, 4)
l_p_norm(x, p = 2, type = "lp")
l_p_norm(x, p = 2, type = "ssq")
l_p_norm(x, p = "max", type = "lp")
l_p_norm(x, p = 1, type = "ssq")

y <- c(3, 4, 5, 6)
l_p_norm(y, p = 4, type = "lp")
l_p_norm(y, p = 3, type = "ssq")


[Package amp version 1.0.0 Index]