minkowski: Minkowski distance

Description Usage Arguments Details Value

Description

The Minkowski metric is a generalized form of Euclidean (p=2) and Manhattan (p=1) distance.

Usage

1
minkowski(x, y, p = 1)

Arguments

x, y

Numeric vectors.

p

Exponent parameter, a single number greater than zero.

Details

For vectors x and y, the Minkowski distance is defined as

d(x, y) = ≤ft( ∑_i |x_i - y_i|^p \right)^{1/p}.

Relation to other definitions:

The default value of p = 1 makes this distance equal to the Manhattan distance.

Value

The Minkowski distance between x and y.


abdiv documentation built on Jan. 20, 2020, 5:07 p.m.