Minkowski distance

{{Short description|Vector distance using pth powers}}

{{Distinguish|text=the pseudo-Euclidean metric of the Minkowski space}}

The Minkowski distance or Minkowski metric is a metric in a normed vector space which can be considered as a generalization of both the Euclidean distance and the Manhattan distance. It is named after the Polish mathematician Hermann Minkowski.

File:Minkowski_distance_examples.svg

Definition

The Minkowski distance of order p (where p is an integer) between two points

X = (x_1,x_2,\ldots,x_n) \text{ and } Y = (y_1,y_2,\ldots,y_n) \in \R^n

is defined as:

D\left(X,Y\right) = \biggl(\sum_{i=1}^n |x_i-y_i|^p\biggr)^{\frac{1}{p}}.

For p \geq 1, the Minkowski distance is a metric as a result of the Minkowski inequality.{{citation

| last = Şuhubi | first = Erdoğan S.

| contribution = Chapter V: Metric Spaces

| doi = 10.1007/978-94-017-0141-9_5

| isbn = 9789401701419

| pages = 261–356

| publisher = Springer Netherlands

| title = Functional Analysis

| year = 2003}} When p < 1, the distance between (0, 0) and (1, 1) is 2^{1/p} > 2, but the point (0, 1) is at a distance 1 from both of these points. Since this violates the triangle inequality, for p < 1 it is not a metric. However, a metric can be obtained for these values by simply removing the exponent of 1/p. The resulting metric is also an F-norm.

Minkowski distance is typically used with p being 1 or 2, which correspond to the Manhattan distance and the Euclidean distance, respectively.{{citation

| last1 = Zezula | first1 = Pavel

| last2 = Amato | first2 = Giuseppe

| last3 = Dohnal | first3 = Vlastislav

| last4 = Batko | first4 = Michal

| contribution = Chapter 1, Foundations of Metric Space Searching, Section 3.1, Minkowski Distances

| doi = 10.1007/0-387-29151-2

| isbn = 9780387291512

| page = 10

| publisher = Springer

| series = Advances in Database Systems

| title = Similarity Search: The Metric Space Approach

| year = 2006}} In the limiting case of p reaching infinity, we obtain the Chebyshev distance:

\lim_{p \to \infty}{\biggl(\sum_{i=1}^n |x_i-y_i|^p\biggr)^\frac{1}{p}} = \max_{i=1}^n |x_i-y_i|.

Similarly, for p reaching negative infinity, we have:

\lim_{p \to -\infty}{\biggl(\sum_{i=1}^n |x_i-y_i|^p\biggr)^\frac{1}{p}} = \min_{i=1}^n |x_i-y_i|.

The Minkowski distance can also be viewed as a multiple of the power mean of the component-wise differences between P and Q.

The following figure shows unit circles (the level set of the distance function where all points are at the unit distance from the center) with various values of p:

{{panorama|image=File:2D unit balls.svg|height=200|alt=Unit circles using different Minkowski distance metrics.}}

Applications

The Minkowski metric is very useful in the field of machine learning and AI. Many popular machine learning algorithms use specific distance metrics such as the aforementioned to compare the similarity of two data points. Depending on the nature of the data being analyzed, various metrics can be used. The Minkowski metric is most useful for numerical datasets where one wants to determine the similarity of size between multiple datapoint vectors.

See also

  • {{annotated link|Generalized mean}}
  • {{annotated link|Lp space|L^p space}}
  • {{annotated link|Norm (mathematics)}}
  • {{annotated link|p-norm|p-norm}}

References

{{reflist}}