| generate_graph | R Documentation |
caugi using Erdős-Rényi.Sample a random DAG or CPDAG using Erdős-Rényi for random graph generation.
generate_graph(n, m = NULL, p = NULL, class = c("DAG", "CPDAG"), seed = NULL)
n |
Integer >= 0. Number of nodes in the graph. |
m |
Integer in |
p |
Numeric in |
class |
"DAG" or "CPDAG". When |
seed |
Optional integer; random seed for reproducibility. |
The sampled caugi object. class = "DAG" returns a "DAG";
class = "CPDAG" returns a "CPDAG".
Other simulation functions:
simulate_data()
# generate a random DAG with 5 nodes and 4 edges
dag <- generate_graph(n = 5, m = 4, class = "DAG")
# generate a random CPDAG with 5 nodes and edge probability 0.3
cpdag <- generate_graph(n = 5, p = 0.3, class = "CPDAG")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.