sinkhorn_knopp.Rd
Implements the Sinkhorn--Knopp algorithm for transforming a square matrix with positive entries to a stochastic matrix with given common row and column sums (e.g., a doubly stochastic matrix).
input matrix
desired row/column sums
number of iterations
convergence tolerance
whether to compute symmetric scaling D A D
whether to print the current change
Computes diagonal matrices D1 and D2 to make D1AD2 into a matrix with
given row/column sums. For a symmetric matrix A
, one can set sym = T
to
compute a symmetric scaling DAD.