rsbm: Generate a graph adjacency matrix using a Stochastic Block...

View source: R/tools_generator.R

rsbmR Documentation

Generate a graph adjacency matrix using a Stochastic Block Model

Description

rsbm returns the adjacency matrix and the cluster labels generated randomly with a Stochastic Block Model.

Usage

rsbm(N, pi, mu)

Arguments

N

The size of the graph to generate

pi

A numeric vector of length K with clusters proportions (will be normalized to sum up to 1).

mu

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

Details

This function takes the desired graph size, cluster proportions and connectivity matrix as input and sample a graph accordingly together with the clusters labels.

Value

A list with fields:

  • x: the graph adjacency matrix as a dgCMatrix

  • K: number of generated clusters

  • N: number of vertex

  • cl: vector of clusters labels

  • pi: clusters proportions

  • mu: connectivity matrix

Examples

simu <- rsbm(100, rep(1 / 5, 5), diag(rep(0.1, 5)) + 0.001)

comeetie/greed documentation built on Oct. 10, 2022, 5:37 p.m.