Description Usage Arguments Value Examples
This function samples a realization of a stochastic block model from a set a user-defined parameters in a igraĥ format.
1 | rSBM(nbNodes, connectParam, blockProp)
|
nbNodes |
number of nodes in the graph |
connectParam |
inter and intra block connection probabilities |
blockProp |
proportion of node in each block of the SBM |
an igraph object with a vertex attribute called "memberships" for block belonging
1 2 3 4 5 6 7 8 9 10 11 | ## graph parameters
nNodes <- 90
blockProp <- c(.5, .25, .25) # group proportions
nbBlock <- length(blockProp) # number of blocks
connectParam <- diag(.4, nbBlock) + 0.05 # connectivity matrix: affiliation network
## Graph Sampling
mySBM <- rSBM(nNodes, connectParam, blockProp)
## Graph plotting
plot(mySBM, vertex.color = igraph::V(mySBM)$memberships)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.