Simulates a random directed acyclic graph adjacency (DAG) matrix with n nodes
and either m edges, edge creation probability p, or edge creation
probability range p_range.
Usage
sim_dag(n, m = NULL, p = NULL)
Value
The sampled caugi object.
Arguments
n
The number of nodes.
m
Integer in 0, n*(n-1)/2. Number of edges in the graph. Exactly one
of m or p must be supplied.
p
Numeric in [0,1]. Probability of edge creation. Exactly one of
m or p must be supplied.
# Simulate a DAG with 5 nodes and 3 edgessim_dag(n = 5, m = 3)
# Simulate a DAG with 5 nodes and edge creation probability of 0.2sim_dag(n = 5, p = 0.2)