sinkhorn_knopp | R Documentation |
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).
sinkhorn_knopp( A, sums = rep(1, nrow(A)), niter = 100, tol = 1e-08, sym = FALSE, verb = FALSE )
A |
input matrix |
sums |
desired row/column sums |
niter |
number of iterations |
tol |
convergence tolerance |
sym |
whether to compute symmetric scaling D A D |
verb |
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 = TRUE
to
compute a symmetric scaling DAD.
Diagonal matrices D1 and D2 to make D1AD2 into a matrix with given row/column sums.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.