Minkowski distance

From HandWiki
Short description: Vector distance function

The Minkowski distance or Minkowski metric is a family of distance functions on a real coordinate space, defined by taking the pth power along each coordinate, given a positive parameter p. That is, it is the distance function associated to a p-norm. It is a generalization of both the Euclidean distance (p=2) and the Manhattan distance (p=1). It is named after the mathematician Hermann Minkowski.

Comparison of Chebyshev, Euclidean and taxicab/Manhattan distances for the hypotenuse of a 3-4-5 triangle on a chessboard (represented by a king, an ant, and a wazir). The wazir moves like a rook but only one square at a time.

Definition

The Minkowski distance of order p (where p≥1) between two points X=(x1,x2,…,xn) and Y=(y1,y2,…,yn)∈ℝn is defined as: Dp(X,Y)=(∑i=1n|xi−yi|p)1p. This is the metric associated to the norm ‖X‖p=(∑i=1n|xi|p)1/p

The Minkowski distance is a metric as a result of the Minkowski inequality,[1] ‖X+Y‖p≤‖X‖p+‖Y‖p. Geometrically, this is a norm because the unit balls ‖X‖p<1 are bounded and open in the standard topology, contain the origin, and are convex and balanced (invariant under X→−X).

When 0<p<1, the same formula does not define a metric because it fails to satisfy the triangle inequality. For example, distance between (0,0) and (1,1) is 21/p>2, but the point (0,1) is at a distance 1 from both of these points.

However, a metric can be obtained for these values by removing the exponent of 1/p: dp(X,Y)=∑i=1n|xi−yi|p,0<p<1. The resulting metric is also an F-norm, but does not come from a norm: the unit balls are not convex.

Minkowski distance is often used with p=1 or p=2, which correspond to the Manhattan distance and the Euclidean distance, respectively.[2] In the limiting case of p approaching infinity, we obtain the Chebyshev distance: limp→∞(∑i=1n|xi−yi|p)1p=maxi=1n|xi−yi|.

The limit as p→0+ of the metric dp is sometimes called the 0-distance or Hamming distance; it counts the number of coordinates xi that differ from the coordinates yi. This distance function is a metric, but like dp, it does not arise from a norm.

The Minkowski distance can 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:

Unit circles using different Minkowski distance metrics.

Applications

The Minkowski distance is useful in the field of machine learning.[3] 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

  • Generalized mean – N-th root of the arithmetic mean of the given numbers raised to the power n
  • Lp space – Function spaces generalizing finite-dimensional p norm spaces
  • Norm (mathematics) – Length in a vector space

References

  1. ↑ Şuhubi, Erdoğan S. (2003), "Chapter V: Metric Spaces", Functional Analysis, Springer Netherlands, pp. 261–356, doi:10.1007/978-94-017-0141-9_5, ISBN 9789401701419 
  2. ↑ Zezula, Pavel; Amato, Giuseppe; Dohnal, Vlastislav; Batko, Michal (2006), "Chapter 1, Foundations of Metric Space Searching, Section 3.1, Minkowski Distances", Similarity Search: The Metric Space Approach, Advances in Database Systems, Springer, p. 10, doi:10.1007/0-387-29151-2, ISBN 9780387291512 
  3. ↑ Duda; Duda, Richard O.; Hart, Peter E. (2006) (in en). Pattern Classification. Wiley-India. ISBN 978-81-265-1116-7. https://books.google.com/books/about/Pattern_Classification.html?id=NR-SzW2t7WYC. 

Template:Lp spaces