The loop is NOT stopped by the tolerance: exactly max_iter scalings
are performed, the marginal violation after each is recorded, and the
first index below tol is read off the finished trace. Cuturi
(2013), Sec. 4.1; Peyre & Cuturi (2019), Sec. 4.2.
Examples
Otsinkit(a = c(1, 2, 3, 4, 5, 6, 7, 8), b = 5L, C = c(1, 2, 3, 4, 5, 6, 7, 8), epsilon = 5L,
tol = 0.5)
#> $estimate
#> [1] 1
#>
#> $reached
#> [1] TRUE
#>
#> $final_error
#> [1] 0
#>
#> $trace
#> [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [38] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [75] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [112] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [149] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [186] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#>
#> $method
#> [1] "Sinkhorn iterations to reach tol, from a fixed-length trace -- Cuturi (2013) Sec. 4.1"
#>
