Closed njanakiev closed 2 years ago
I am not familiar with the other library, but the result from PyEMD looks correct. If the two histograms are equal, then the earth mover's distance between them is zero, as no mass needs to be moved.
Probably the discrepancy can be explained by the fact that the distance matrix you're using does not represent a metric, as it doesn't satisfy any of the metric axioms. As described in the documentation, PyEMD's implementation assumes these properties and does not check them; results are not guaranteed to be correct if they are not satisfied. In particular, there is no identity of indiscernibles, since the diagonal of the matrix is not zero. My guess is that the implementation of the other library deals with this differently.
Thanks for the project!
I've been comparing the results between pyemd and PythonOT/POT and I found inconsistencies in the results. Not sure if I am applying it in a wrong way.
Here is the code to reproduce it:
Output:
In fact, the earth mover distance is usually 0 for histograms that are uniform.
Here with POT:
Output:
The flow is also different in this case.
Am I missing something or is this some issue with the code in either repository?