fast_sbm {nett} | R Documentation |
Samples an adjacency matrix from a stochastic block model (SBM)
fast_sbm(z, B)
z |
Node labels ( |
B |
Connectivity matrix ( |
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))