causaldag.classes.dag.DAG.cpdag¶
-
DAG.cpdag()[source]¶ Return the completed partially directed acyclic graph (CPDAG, aka essential graph) that represents the Markov equivalence class of this DAG.
Returns: CPDAG representing the MEC of this DAG. Return type: causaldag.PDAG Examples
>>> import causaldag as cd >>> g = cd.DAG(arcs={(1, 2), (2, 4), (3, 4)}) >>> cpdag = g.cpdag() >>> cpdag.edges {frozenset({1, 2})} >>> cpdag.arcs {(2, 4), (3, 4)}