sample_hierarchical_sbm | R Documentation |
Sampling from a hierarchical stochastic block model of networks.
sample_hierarchical_sbm(n, m, rho, C, p)
hierarchical_sbm(...)
n |
Integer scalar, the number of vertices. |
m |
Integer scalar, the number of vertices per block. |
rho |
Numeric vector, the fraction of vertices per cluster, within a
block. Must sum up to 1, and |
C |
A square, symmetric numeric matrix, the Bernoulli rates for the
clusters within a block. Its size must mach the size of the |
p |
Numeric scalar, the Bernoulli rate of connections between vertices in different blocks. |
... |
Passed to |
The function generates a random graph according to the hierarchical stochastic block model.
An igraph graph.
Gabor Csardi csardi.gabor@gmail.com
Random graph models (games)
erdos.renyi.game()
,
sample_()
,
sample_bipartite()
,
sample_chung_lu()
,
sample_correlated_gnp()
,
sample_correlated_gnp_pair()
,
sample_degseq()
,
sample_dot_product()
,
sample_fitness()
,
sample_fitness_pl()
,
sample_forestfire()
,
sample_gnm()
,
sample_gnp()
,
sample_grg()
,
sample_growing()
,
sample_islands()
,
sample_k_regular()
,
sample_last_cit()
,
sample_pa()
,
sample_pa_age()
,
sample_pref()
,
sample_sbm()
,
sample_smallworld()
,
sample_traits_callaway()
,
sample_tree()
## Ten blocks with three clusters each
C <- matrix(c(
1, 3 / 4, 0,
3 / 4, 0, 3 / 4,
0, 3 / 4, 3 / 4
), nrow = 3)
g <- sample_hierarchical_sbm(100, 10, rho = c(3, 3, 4) / 10, C = C, p = 1 / 20)
g
if (require(Matrix)) {
image(g[])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.