Skip to contents

The Gaussian family is closed under optimal transport: the optimal map is affine and the cost splits into a mean part and a covariance part, the latter being the Bures metric. This is the one multivariate case with a closed form, which makes it the natural anchor for every numerical transport solver.

Usage

Otwsg(mu1, Sigma1, mu2, Sigma2)

Arguments

mu1, mu2

Mean vectors of length d.

Sigma1, Sigma2

Covariance matrices, symmetric positive semi-definite.

Value

List with W2, W2_sq, mean_part, bures_sq, d.

Details

Formula: \(W_2^2 = ||m1 - m2||^2 + tr(S1 + S2 - 2 (S1^{1/2} S2 S1^{1/2})^{1/2})\) – Peyre and Cuturi (2019) eq. (2.41)-(2.42), p. 34; Olkin and Pukelsheim (1982).

References

Olkin, I. and Pukelsheim, F. (1982). Linear Algebra and its Applications 48:257-263. doi:10.1016/0024-3795(82)90112-4 .

Examples

Otwsg(mu1 = c(0, 0), Sigma1 = diag(2), mu2 = c(3, 4), Sigma2 = diag(2))$W2   # 5: covariances agree
#> [1] 5