Learn R Programming

pcalg (version 1.1-4)

dag2cpdag: 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)

Value

  • A graph object containing the CPDAG.

Details

This function converts a DAG (graph object) to its corresponding (unique) CPDAG (graph object), using the algorithm of Chickering (2002).

References

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

See Also

udag2pdag, pdag2dag

Examples

Run this code
p <- 10 # number of random variables
s <- 0.4 # sparseness of the graph

## generate random data
set.seed(42)
g <- randomDAG(p,s) # generate a random DAG

res <- dag2cpdag(g)

Run the code above in your browser using DataLab