dag2cpdag {pcalg}R Documentation

Convert a DAG to a CPDAG

Description

Convert a DAG to a Completed Partially Directed Acyclic Graph (CPDAG).

Usage

dag2cpdag(dag)

Arguments

dag DAG (graph object)

Details

This function converts a DAG (graph object) to its corresponding (unique) CPDAG (graph object). We use the algorithm used by Chickering (see References).

Value

An adjacency matrix containing the CPDAG.

Author(s)

Markus Kalisch (kalisch@stat.math.ethz.ch)

References

D.M. Chickering, Learning Equivalence Classes of Bayesian-Network Structures, Journal of Machine Learning Research 2 (2002), 445-398

See Also

udag2pdag,pdag2dag

Examples

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)

[Package pcalg version 0.1-7 Index]