generate_network: Simulates random graph, optionally a DAG

View source: R/simulate.R

generate_networkR Documentation

Simulates random graph, optionally a DAG

Description

Edges are sampled from a PERT distribution with random sign. By default these are between 0.05 and 0.8 with a mode of 0.2 and intended to represent "root variance-explained".

Usage

generate_network(
  D,
  graph = "scalefree",
  p = 0.4,
  v = 0.2,
  DAG = FALSE,
  max_eig = 0.9
)

Arguments

D

Integer. Number of nodes to simulate.

graph

String. One of 'scalefree' or 'random'. Type of network to simulate.

p

Float between 0 and 1. Parameter for network generation. For scalefree, p is the probability of adding a new node at each iteration. For random, it is the probability of including each edge.

v

Float. Mode of the pert distribution for simulated edge weights.

DAG

Bool. TRUE to ensure the returned graph is a DAG.


brielin/inspre documentation built on Dec. 3, 2023, 4:55 a.m.