Learn R Programming

BIDistances (version 0.1.3)

WassersteinDist: Wasserstein Distance

Description

Computes the Wasserstein distance for a data matrix

Usage

WassersteinDist(Data, p = 1, InverseWeighting = FALSE)

Value

matrix of distances, symmetric

Arguments

Data

data matrix of n cases and d feautures

p

scalar higher than one, the power to which the Euclidean distance between points is taken in order to compute transportation costs.

InverseWeighting

weighting per row can be either 1 (FALSE) or 1/n (TRUE)

Author

Michae Thrun

Details

Wasserstein distance, also known as Earth Mover’s Distance (EMD) is the distance between two probability distributions over a region D. The Wasserstein distance of order p is defined as the p-th root of the total cost incurred when transporting measure a to measure b in an optimal way, where the cost of transporting a unit of mass from x to y is given as the p-th power of the Euclidean distance.

It is claimed to be useful for distributions that do not align well with traditional measures like Euclidean distance.

References

...

See Also

wasserstein1d

Examples

Run this code
data(Hepta)
distMat=WassersteinDist(Hepta$Data)

Run the code above in your browser using DataLab