# NOT RUN {
## SBM parameters
directed <- FALSE
N <- 300 # number of nodes
Q <- 3 # number of clusters
alpha <- rep(1,Q)/Q # mixture parameter
pi <- diag(.45,Q) + .05 # connectivity matrix
gamma <- log(pi/(1-pi)) # logit transform fo the model with covariates
M <- 2 # two Gaussian covariates
covarMatrix <- matrix(rnorm(N*M,mean = 0, sd = 1), N, M)
covarParam <- rnorm(M, -1, 1)
## draw a SBM without covariates through simulateSBM
sbm <- missSBM::simulate(N, alpha, pi, directed)
## equivalent construction from the SBM_sampler class itslef
sbm_s <- SBM_sampler$new(directed, N, alpha, pi)
sbm_s$rBlocks() # draw some blocks
sbm_s$rAdjMatrix() # draw some edges
# }
Run the code above in your browser using DataCamp Workspace