Skip to contents

The Euclidean average of two shifted bumps is two bumps; the Wasserstein average is one bump in between. The barycentre respects the geometry of the ground space rather than the vector-space structure of the histograms. Fixing the support turns the problem into a coupled set of Sinkhorn problems sharing a common row scaling.

Usage

Otbar(A, C_list, weights, epsilon, max_iter = 200)

Arguments

A

Input histograms, n by K, one per column.

C_list

List of K cost matrices, each n by n.

weights

Barycentric weights; rescaled to sum to one.

epsilon

Entropic strength, positive.

max_iter

Sweeps.

Value

List with bary, mass, n, K, iters.

Details

Formula: \(rgmin_nu sum_k w_k OT_eps(mu_k, nu)\), solved by u_k = nu/(K_k v_k), nu = prod_k (K_k v_k)^{w_k}, \(v_k = mu_k/(K_k' u_k)\) – Benamou et al. (2015) Section 3.2; Peyre and Cuturi (2019) eq. (9.11), (9.15)

References

Benamou, J.-D. et al. (2015). SIAM Journal on Scientific Computing 37(2):A1111-A1138. doi:10.1137/141000439 . Cuturi, M. and Doucet, A. (2014). Proceedings of Machine Learning Research 32:685-693 (ICML).

Examples

x <- 1:5
C <- outer(x, x, function(a, b) (a - b)^2)
A <- cbind(c(1, 0, 0, 0, 0), c(0, 0, 0, 0, 1))
round(Otbar(A, list(C, C), weights = c(0.5, 0.5), epsilon = 0.5)$bary, 3)  # mass moves to the middle
#> [1] 0.000 0.106 0.787 0.106 0.000