fast_sbm | R Documentation |
Samples an adjacency matrix from a stochastic block model (SBM)
fast_sbm(z, B)
z |
Node labels (n * 1) |
B |
Connectivity matrix (K * K) |
The function implements a fast algorithm for sampling sparse SBMs, by only sampling the necessary nonzero entries. This function is adapted almost verbatim from the original code by Aiyou Chen.
An adjacency matrix following SBM
B = pp_conn(n = 10^4, oir = 0.1, lambda = 7, pri = rep(1,3))$B head(fast_sbm(sample(1:3, 10^4, replace = TRUE), B))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.