wasserstein: wasserstein

Description Usage Value

View source: R/wasserstein.R

Description

Compute regularized Wasserstein distance between two empirical distributions, p and q, specified as vector of probabilities summing to one. The third argument is the cost matrix, i.e. a matrix of pair-wise distances, the fourth argument is the regularization parameter, e.g. 0.05*median(cost_matrix), and the last argument is the number of Sinkhorn iterations to perform, e.g. 100. Important references are

- Cuturi, M. (2013). Sinkhorn distances: Lightspeed computation of optimal transport. In Advances in Neural Information Processing Systems (NIPS), pages 2292-2300.

- Cuturi, M. and Doucet, A. (2014). Fast computation of Wasserstein barycenters. In Proceedings of the 31st International Conference on Machine Learning (ICML), pages 685-693.

Usage

1
wasserstein(p, q, cost_matrix, epsilon, niterations)

Value

a list with "distances", "transportmatrix", "u" and "v"


pierrejacob/winference documentation built on Feb. 17, 2020, 10:28 p.m.