Learn R Programming

shock (version 1.0)

simulateBlockDiagNetwork: Simulate a modular network

Description

This function simulates a modular network with p variables based on the partition of variables into blocks labels.

Usage

simulateBlockDiagNetwork(p, labels)

Arguments

p
number of variables in the network
labels
vector indicating the partition of variables into blocks

Value

  • Asimulated adjacency matrix
  • Csimulated correlation matrix
  • Pcorsimulated partial correlation matrix
  • labelsvector indicating the partition of variables into blocks provided as input of the function

Details

To simulate covariance matrices, we use the methodology detailed in Giraud, S. Huet, and N. Verzelen. Graph selection with GGMselect. 2009 http://fr.arxiv.org/abs/0907.0619 https://cran.r-project.org/package=GGMselect

Examples

Run this code
## number of variables
p <- 100
## number of blocks
K <- 15
## vector of partition into blocks
labels <- factor(rep(1:K, length.out=p))
## simulate network 
g <- simulateBlockDiagNetwork(p,labels)

Run the code above in your browser using DataLab