Formula: M = diag(u) K diag(v) with u <- r / (K v) and v <- c / (K' u), alternated
Usage
Rasscale(K, row_target, col_target, max_iter = 200)
Arguments
- K
See Usage.
- row_target
See Usage.
- col_target
See Usage.
- max_iter
See Usage.
Value
List with M, u, v, row_error, col_error, iterations.
References
Bregman (1967), The relaxation method of finding the common point of
convex sets, USSR Computational Mathematics and Mathematical Physics 7:200-217. Not
held locally; alternating diagonal scaling to fixed margins (RAS, Sinkhorn-Knopp) is
the standard published form of the method.
Examples
K <- matrix(c(2, 1, 1, 3), 2)
M <- Rasscale(K, row_target = c(4, 6), col_target = c(5, 5))
M$estimate
#> NULL