Skip to main content

Convert a DAG to its CPDAG

Source: R/transform.R, R/jlbind-wrappers.R

Description

Returns the CPDAG representing the Markov equivalence class (MEC) of the DAG cg. Unshielded colliders (v-structures) determine which edges are compelled, an initial PDAG is built from the skeleton with those orientations, and meek_closure() propagates the rest.

Usage

Arguments

cg A DAG created with cgraph().

Value

A cgraph of class CPDAG.

Examples

dag <- cgraph(A %-->% B, B %-->% C)
dag_to_cpdag(dag)
#> CPDAG with 3 nodes and 2 edges:
#>   nodes: A, B, C
#>   edges:
#>     A --- B, B --- C