sample_dsbm {motifcluster}R Documentation

Sample a directed stochastic block model (DSBM)

Description

Sample the (weighted) adjacency matrix of a (weighted) directed stochastic block model (DSBM) with specified parameters.

Usage

sample_dsbm(
  block_sizes,
  connection_matrix,
  weight_matrix = NULL,
  sample_weight_type = c("unweighted", "constant", "poisson")
)

Arguments

block_sizes

A vector containing the size of each block of vertices.

connection_matrix

A matrix containing the block-to-block connection probabilities.

weight_matrix

A matrix containing the block-to-block weight parameters. Unused for sample_weight_type = "constant". Defaults to NULL.

sample_weight_type

The type of weighting scheme. One of "unweighted", "constant" or "poisson".

Value

A randomly sampled (weighted) adjacency matrix of a DSBM.

Examples

block_sizes <- c(10, 10)
connection_matrix <- matrix(c(0.8, 0.1, 0.1, 0.8), nrow = 2, byrow = TRUE)
weight_matrix <- matrix(c(10, 3, 3, 10), nrow = 2, byrow = TRUE)
sample_dsbm(block_sizes, connection_matrix, weight_matrix, "poisson")

[Package motifcluster version 0.2.3 Index]