graphical_models.classes.dags.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

>>> from graphical_models import DAG
>>> g = DAG(arcs={(1, 2), (2, 4), (3, 4)})
>>> cpdag = g.cpdag()
>>> cpdag.edges
{frozenset({1, 2})}
>>> cpdag.arcs
{(2, 4), (3, 4)}