set.seed(27)
lazy_overlapping_sbm <- overlapping_sbm(n = 1000, k = 5, expected_density = 0.01)
lazy_overlapping_sbm
# sometimes you gotta let the world burn and
# sample a wildly dense graph
dense_lazy_overlapping_sbm <- overlapping_sbm(n = 500, k = 3, expected_density = 0.8)
dense_lazy_overlapping_sbm
k <- 5
n <- 1000
B <- matrix(stats::runif(k * k), nrow = k, ncol = k)
pi <- c(1, 2, 4, 1, 1) / 5
custom_overlapping_sbm <- overlapping_sbm(
n = 200,
B = B,
pi = pi,
expected_degree = 5
)
custom_overlapping_sbm
edgelist <- sample_edgelist(custom_overlapping_sbm)
edgelist
# efficient eigendecompostion that leverages low-rank structure in
# E(A) so that you don't have to form E(A) to find eigenvectors,
# as E(A) is typically dense. computation is
# handled via RSpectra
population_eigs <- eigs_sym(custom_overlapping_sbm)
Run the code above in your browser using DataLab