How to compute Wasserstein distance?
Mostra commenti meno recenti
I have two probability distributions in arrays P and Q (normalized by area, of same length, and over same sample space). I want to find Wasserstein distance between them.
I tried to use the Earth Mover Distance from here:
My input was [Y, fval] = emd(X, X, P, Q, @gdf)
where X is the sample space. But it is giving output:
No feasible solution found.
Linprog stopped because no point satisfies the constraints.
Is this the way to compute Wasserstein distance? How do I fix this?
Risposte (1)
Koorosh Aslansefat
il 29 Apr 2020
Modificato: Koorosh Aslansefat
il 29 Apr 2020
1 voto
I have recently added new set of functions for ECDF-based distance measure to MATLAB Exchange.
I would suggest to have a look.
3 Commenti
Georgios Pyrgiotakis
il 13 Mag 2020
I have been looking for something like this! thank you. So if I understood correctly, you can use these functions to find the various distances between two normalized distributions. I have an instrument that is directly exports percentage distribution and not number so I have hard time finding a way to compare the various distributions because I have no n (number of samples).
Koorosh Aslansefat
il 13 Mag 2020
If P and Q can be considered as empirical distribution function (ECDF), then you can use those functions with a bit of modification.
Georgios Pyrgiotakis
il 14 Mag 2020
Modificato: Georgios Pyrgiotakis
il 14 Mag 2020
Yes P and Q are emprical CDF. How can I use these functions? I tried but I get lost. It seems that you start with the data set convert it to CDF and then calculate the area between the two curves?
Categorie
Scopri di più su Exploration and Visualization in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!