JuliaOptimalTransport / ExactOptimalTransport.jl

Solving unregularized optimal transport problems with Julia
https://juliaoptimaltransport.github.io/ExactOptimalTransport.jl/dev
MIT License
17 stars 2 forks source link

Wasserstein disctance for multivariate distributions #38

Open ignace-computing opened 11 months ago

ignace-computing commented 11 months ago

Dear package maintainers,

May I please ask a question? Is there a way to get the following working? In words: applying wasserstein for multivariate distributions.

using KernelFunctions
using ExactOptimalTransport
mu = discretemeasure(RowVecs(rand(7,3)))
nu = discretemeasure(RowVecs(rand(7,3)))
wasserstein(mu,nu)

This throws an error.

Many thanks! Ignace

zsteve commented 11 months ago

Hi @ignace-computing , You seem to be wanting to solve discrete transport between multivariate empirical distributions, and it seems like wasserstein doesn't support that. I haven't got time to investigate in detail yet but my guess is that wasserstein only works for parametric distributions. perhaps try out emd/emd2? these work for general discrete inputs and would require you to explicitly pass a cost matrix together with weights (in your case, uniform).