# Wasserstein metric

In mathematics, the **Wasserstein** (or **Vasershtein**) **metric** is a distance function defined between probability distributions on a given metric space *M*.

Intuitively, if each distribution is viewed as a unit amount of "dirt" piled on *M*, the metric is the minimum "cost" of turning one pile into the other, which is assumed to be the amount of dirt that needs to be moved times the distance it has to be moved. Because of this analogy, the metric is known in computer science as the earth mover's distance.

The name "Wasserstein/Vasershtein distance" was coined by R. L. Dobrushin in 1970, after the Russian mathematician Leonid Nasonovich Vasershtein who introduced the concept in 1969. Most English-language publications use the German spelling "Wasserstein" (attributed to the name "Vasershtein" being of Germanic origin).

## Definition

Let (*M*, *d*) be a metric space for which every probability measure on *M* is a Radon measure (a so-called Radon space). For *p* ≥ 1, let **P**_{p}(*M*) denote the collection of all probability measures *μ* on *M* with finite *p*^{th} moment: for some *x*_{0} in *M*,

Then the ** p^{th} Wasserstein distance** between two probability measures

*μ*and

*ν*in

**P**_{p}(

*M*) is defined as

where Γ(*μ*, *ν*) denotes the collection of all measures on *M* × *M* with marginals *μ* and *ν* on the first and second factors respectively. (The set Γ(*μ*, *ν*) is also called the set of all **couplings** of *μ* and *ν*.)

The above distance is usually denoted *W*_{p}(*μ*, *ν*) (typically among authors who prefer the "Wasserstein" spelling) or ℓ_{p}(*μ*, *ν*) (typically among authors who prefer the "Vasershtein" spelling). The remainder of this article will use the *W*_{p} notation.

The Wasserstein metric may be equivalently defined by

where **E**[*Z*] denotes the expected value of a random variable *Z* and the infimum is taken over all joint distributions of the random variables *X* and *Y* with marginals *μ* and *ν* respectively.

## Applications

The Wasserstein metric is a natural way to compare the probability distributions of two variables *X* and *Y*, where one variable is derived from the other by small, non-uniform perturbations (random or deterministic).

In computer science, for example, the metric *W*_{1} is widely used to compare discrete distributions, *e.g.* the color histograms of two digital images; see earth mover's distance for more details.

## Properties

### Metric structure

It can be shown that *W*_{p} satisfies all the axioms of a metric on **P**_{p}(*M*). Furthermore, convergence with respect to *W*_{p} is equivalent to the usual weak convergence of measures plus convergence of the first *p*th moments.

### Dual representation of *W*_{1}

The following dual representation of *W*_{1} is a special case of the duality theorem of Kantorovich and Rubinstein (1958): when *μ* and *ν* have bounded support,

where Lip(*f*) denotes the minimal Lipschitz constant for *f*.

Compare this with the definition of the Radon metric:

If the metric *d* is bounded by some constant *C*, then

and so convergence in the Radon metric (identical to **total variation convergence** when *M* is a Polish space) implies convergence in the Wasserstein metric, but not vice versa.

### Separability and completeness

For any *p* ≥ 1, the metric space (**P**_{p}(*M*), *W*_{p}) is separable, and is complete if (*M*, *d*) is separable and complete.^{[1]}

## See also

- Lévy metric
- Lévy–Prokhorov metric
- Total variation distance of probability measures
- Transportation theory

## References

- ↑ {{#invoke:Citation/CS1|citation |CitationClass=journal }}

- {{#invoke:citation/CS1|citation

|CitationClass=book }}

- {{#invoke:Citation/CS1|citation

|CitationClass=journal }}

- {{#invoke:citation/CS1|citation

|CitationClass=citation }}