linfnorm: Compute L infinity distance between two vectors of numbers.

linfnormR Documentation

Compute L infinity distance between two vectors of numbers.

Description

Compute L infinity distance between two vectors of numbers (maximum absolute difference between two vectors).

Usage

linfnorm(u,v)

Arguments

u

first vector of numbers

v

second vector of numbers

Details

Function simply computes the L infinity distance between two vectors and is implemented as

max(abs(u-v))

Value

A real number which is the L infinity distance between two vectors.

RELEASE

Version 3.6 Copyright Guy Nason 1995

Note

This function would probably be more accurate if it used the Splus function vecnorm.

Author(s)

G P Nason

See Also

l2norm, wstCV, wstCVl.

Examples

#
# What is the L infinity norm between the following sets of vectors
#
p <- c(1,2,3,4,5)
q <- c(1,2,3,4,5)
r <- c(2,3,4,5,6)
linfnorm(p,q)
# [1] 0
linfnorm(q,r)
# [1] 1
linfnorm(r,p)
# [1] 1

wavethresh documentation built on Nov. 16, 2022, 5:16 p.m.