subwasserstein: Approximate Computation of Wasserstein Distances via Subsampling.
Description
Samples S elements each of a source and a target measure and
computes the Wasserstein distance between the samples.
The mean distance out of K tries is returned.
The source measure has to be either a weight vector or an object
of one of the classes "pgrid", "wpp" or "pp".
target
The target measure needs to be of the same type as the source measure.
S
The sample size.
K
The number of tries. Defaults to 1.
p
The order of the Wasserstein metric (i.e. the power of the distances). Defaults to 1.
costM
The cost matrix between the source and target measures. Ignored unless source
and target are weight vectors.
prob
logical. Should the objects a, b be interpreted as probability measures, i.e. their
total mass be normalized to 1?
precompute
logical. Should the cost matrix for the large problem be precomputed?
method
A string with the name of the method used for optimal transport distance computation.
Options are "networkflow", revsimplex", "shortsimplex" and "primaldual".
Value
The mean of the K values of the Wasserstein distances between
the subsampled measures.
Details
For larger problems setting precompute to TRUE is not recommended.
References
M. Sommerfeld, J. Schrieber, Y. Zemel and A. Munk (2018)
Optimal Transport: Fast Probabilistic Approximation with Exact Solvers
preprint: arXiv:1802.05570