Skip to contents

$$d^\lambda_M(r,c) = \langle P^\lambda, M\rangle$$ Cuturi (2013), Definition 1 and eq. (2). Cuturi parameterises by lambda; here eps = 1/lambda, so K = exp(-C/eps). Both the transport cost and the regularised objective are returned, because they are different numbers and are routinely confused.

Usage

Sinkdist(a, b, C, eps, max_iter = 200L)

Arguments

a, b

Non-negative marginals; closed here.

C

Cost matrix.

eps

Positive regularisation strength, 1/lambda.

max_iter

Fixed number of scalings (default 200).

Value

Named list with estimate, objective, entropy, lambda_, iters, method.

References

Cuturi (2013), Definition 1, eq. (2).

Examples

Sinkdist(a = c(1, 2, 3, 4, 5, 6, 7, 8), b = 5L, C = c(1, 2, 3, 4, 5, 6, 7, 8), eps = 0.5)
#> $estimate
#> [1] 5.666667
#> 
#> $objective
#> [1] 4.198268
#> 
#> $entropy
#> [1] 2.936798
#> 
#> $lambda_
#> [1] 2
#> 
#> $iters
#> [1] 200
#> 
#> $method
#> [1] "Dual-Sinkhorn divergence <P,C> -- Cuturi (2013) Def. 1, eq. (2)"
#>