An S4 class to represent a Stochastic Block Model, extends icl_model-class. Such model can be used to cluster graph vertex, and model a square adjacency matrix \(X\) with the following generative model : $$ \pi \sim Dirichlet(\alpha)$$ $$ Z_i \sim \mathcal{M}(1,\pi)$$ $$ \theta_{kl} \sim Beta(a_0,b_0)$$ $$ X_{ij}|Z_{ik}Z_{jl}=1 \sim \mathcal{B}(\theta_{kl})$$ This class mainly store the prior parameters value \(\alpha,a_0,b_0\) of this generative model in the following slots:

Slots

name

name of the model

alpha

Dirichlet over cluster proportions prior parameter (default to 1)

a0

Beta prior parameter over links (default to 1)

b0

Beta prior parameter over no-links (default to 1)

type

define the type of networks (either "directed" or "undirected", default to "directed"), for undirected graphs the adjacency matrix is supposed to be symmetric.

References

Nowicki, Krzysztof and Tom A B Snijders (2001). “Estimation and prediction for stochastic block structures”. In:Journal of the American statistical association 96.455, pp. 1077–1087

See also

Examples

new("sbm")
#> An object of class "sbm" #> Slot "a0": #> [1] 1 #> #> Slot "b0": #> [1] 1 #> #> Slot "type": #> [1] "directed" #> #> Slot "name": #> [1] "sbm" #> #> Slot "alpha": #> [1] 1 #>
new("sbm",a0=0.5, b0= 0.5,alpha=0.5)
#> An object of class "sbm" #> Slot "a0": #> [1] 0.5 #> #> Slot "b0": #> [1] 0.5 #> #> Slot "type": #> [1] "directed" #> #> Slot "name": #> [1] "sbm" #> #> Slot "alpha": #> [1] 0.5 #>
sbm = rsbm(100,c(0.5,0.5),diag(2)*0.1+0.01) sol = greed(sbm$x,model=new("sbm",a0=0.5, b0= 0.5,alpha=0.5))
#> ------- directed SBM model fitting ------ #> ################# Generation 1: best solution with an ICL of -2132 and 2 clusters ################# #> ################# Generation 2: best solution with an ICL of -2132 and 2 clusters ################# #> ------- Final clustering ------- #> ICL clustering with a SBM model, 2 clusters and an icl of -2132.