simnetwork: Simulating Network Data

View source: R/auxfunc.R

simnetworkR Documentation

Simulating Network Data

Description

simnetwork generates adjacency matrices based on specified probabilities.

Usage

simnetwork(dnetwork, normalise = FALSE)

Arguments

dnetwork

A list of sub-network matrices, where the (i, j)-th position of the m-th matrix represents the probability that individual i is connected to individual j in the m-th network.

normalise

A boolean indicating whether the returned matrices should be row-normalized (TRUE) or not (FALSE).

Value

A list of (row-normalized) adjacency matrices.

Examples

# Generate a list of adjacency matrices
## Sub-network sizes
N         <- c(250, 370, 120)  
## Probability distributions
dnetwork  <- lapply(N, function(x) matrix(runif(x^2), x))
## Generate networks
G         <- simnetwork(dnetwork)

CDatanet documentation built on April 3, 2025, 11:07 p.m.