dag2cpdag {pcalg} | R Documentation |
Convert a DAG to a Completed Partially Directed Acyclic Graph (CPDAG).
dag2cpdag(dag)
dag |
DAG (graph object) |
This function converts a DAG (graph object) to its corresponding (unique) CPDAG (graph object). We use the algorithm used by Chickering (see References).
An adjacency matrix containing the CPDAG.
Markus Kalisch (kalisch@stat.math.ethz.ch)
D.M. Chickering, Learning Equivalence Classes of Bayesian-Network Structures, Journal of Machine Learning Research 2 (2002), 445-398
p <- 10 # number of random variables s <- 0.4 # sparsness of the graph ## generate random data set.seed(42) g <- randomDAG(p,s) # generate a random DAG res <- dag2cpdag(g)