$$F = \langle T,C\rangle - \varepsilon H(T) - \langle a,f\rangle - \langle b,g\rangle$$
Peyre & Cuturi (2019), eq. (4.30)-(4.32). Zero at optimality.
Usage
Otfreeen(T, C, a, b, f, g, epsilon)
Arguments
- T
Coupling matrix.
- C
Cost matrix of the same shape.
- a, b
Marginals; closed here.
- f, g
Dual potentials, in the units of C.
- epsilon
Positive regularisation strength.
Value
Named list with estimate, primal, dual_pairing,
entropy, epsilon, method.
References
Peyre & Cuturi (2019), eq. (4.30)-(4.32).
Examples
a <- c(0.5, 0.5); b <- c(0.5, 0.5)
C <- matrix(c(0, 1, 1, 0), 2)
Otfreeen(T = diag(0.5, 2), C = C, a = a, b = b, f = c(0, 0), g = c(0, 0), epsilon = 0.1)$estimate
#> [1] -0.1693147