-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple alternative to Earth Mover's Distance (1D distributions) #16
Comments
So that's a slightly incorrect implementation but mostly right, the function should be np.sum(np.abs(np.cumsum(comp1.ratio_vector - comp2.ratio_vector))) The justification is given on page 31 of Computational Optimal Transport, the other tests have been really useful checking the last bug so would be interesting to see how this compares in accuracy and speed |
Added this to ElMD==0.5.3 as per this reference https://arxiv.org/pdf/1804.01947.pdf |
Do you know if there's a relation to Cramer's approximation used in |
I can't answer with full confidence as I'm not hugely familiar with the Cramer approximation, but it looks like the definition given by We can verify this in their code: def wasserstein_distance(u_values, v_values, u_weights=None, v_weights=None):
return _cdf_distance(1, u_values, v_values, u_weights, v_weights)
def energy_distance(u_values, v_values, u_weights=None, v_weights=None):
return np.sqrt(2) * _cdf_distance(2, u_values, v_values,
u_weights, v_weights) The |
Hey Cameron, it was great to meet with you earlier. I've been thinking more about the equation that you mentioned, and was wondering how this could be the correct Earth Mover's distance if it doesn't consider the
mod_petti
features (i.e. the equation doesn't seem to incorporate weights)?The text was updated successfully, but these errors were encountered: