View source: R/spatial_weights.R
make_doubly_stochastic | R Documentation |
This function iteratively computes the doubly stochastic matrix from a given input matrix. A doubly stochastic matrix is a matrix in which both row and column elements sum to 1.
make_doubly_stochastic(A, iter = 30)
A |
A numeric matrix for which to compute the doubly stochastic matrix |
iter |
Integer, the number of iterations to perform (default is 30) |
A numeric matrix representing the computed doubly stochastic matrix
# Create an example matrix
A <- matrix(c(2, 4, 6, 8, 10, 12), nrow = 3, ncol = 2)
# Compute the doubly stochastic matrix
result <- make_doubly_stochastic(A, iter = 30)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.