subwasserstein {transport} | R Documentation |
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.
subwasserstein(source, target, S, K = 1, p = 1, costM = NULL, prob = TRUE, precompute = FALSE, method = "networkflow")
source |
The source measure has to be either a weight vector or an object
of one of the classes |
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". |
For larger problems setting precompute
to TRUE
is not recommended.
The mean of the K values of the Wasserstein distances between the subsampled measures.
Jörn Schrieber joern.schrieber-1@mathematik.uni-goettingen.de
Dominic Schuhmacher schuhmacher@math.uni-goettingen.de
M. Sommerfeld, J. Schrieber, Y. Zemel and A. Munk (2018) Optimal Transport: Fast Probabilistic Approximation with Exact Solvers preprint: arXiv:1802.05570
## Not run: subwasserstein(random64a, random64b, S=1000) wasserstein(random64a, random64b) ## End(Not run)