ws_dist: Compute the p-Wasserstein distance between two measures
Description
This is essentially a wrapper function of transport. It has the advantage of allowing
more general input objects, such as images or matrices, without the user having to manually convert these objects.
Usage
ws_dist(A, B, p = 2, sampling = FALSE, S = NULL, R = NULL)
Arguments
A
One of the following: A matrix, representing an image;
A file name containing an image; A wpp-object.
B
One of the following: A matrix, representing an image;
A file name containing an image; A wpp-object.
p
A positive real number specifying the power of the Wasserstein distance.
sampling
A boolean specifying whether a stochastic approximation (Sommerfeld et al., 2019) should be used to approximate the distance.
S
A positive integer specifying the number of samples drawn in the stochastic approximation.
R
The number of repetitions averaged over in the stochastic approximation.
Value
A number specifying the computed p-Wasserstein distance.
References
M Sommerfeld, J Schrieber, Y Zemel, and A Munk (2019).
Optimal transport: Fast probabilistic approximations with exact solvers. Journal of Machine Learning Research 20(105):1--23.