View source: R/WassersteinDist.R
WassersteinDist | R Documentation |
Computes the Wasserstein distance for a data matrix
WassersteinDist(Data, p = 1, InverseWeighting = FALSE)
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) |
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.
matrix of distances, symmetric
Michae Thrun
...
wasserstein1d
data(Hepta)
distMat=WassersteinDist(Hepta$Data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.