rdcsbm returns an adjacency matrix and the cluster labels generated randomly using a Degree Corrected Stochastic Block Model.

rdcsbm(N, pi, mu, betain, betaout)

Arguments

N

A numeric value the size of the graph to generate

pi

A numeric vector of length K with clusters proportions. Must sum up to 1.

mu

A numeric matrix of dim K x K with the connectivity pattern to generate, elements in [0,1].

betain

A numeric vector of length N which specify the in-degree correction will be normalized per cluster during the generation.

betaout

A numeric vector of length N which specify the out-degree correction will be normalized per cluster during the generation.

Value

A list with fields:

  • x: the count matrix as a dgCMatrix

  • K: number of generated clusters

  • N: number of vertex

  • cl: vector of clusters labels

  • pi: clusters proportions

  • mu: connectivity matrix

  • betain: normalized in-degree parameters

  • betaout: normalized out-degree parameters

Details

It takes the sample size, cluster proportions and emission matrix, and as input and sample a graph accordingly together with the clusters labels.