graphical_models.classes.dags.dag.DAG.markov_equivalent
- DAG.markov_equivalent(other, interventions=None) bool [source]
Check if this DAG is (interventionally) Markov equivalent to the DAG
other
.- Parameters
other – Another DAG.
interventions – If not None, check whether the two DAGs are interventionally Markov equivalent under the interventions.
Examples
>>> from graphical_models import DAG >>> d1 = DAG(arcs={(0, 1), (1, 2)}) >>> d2 = DAG(arcs={(2, 1), (1, 0)}) >>> d3 = DAG(arcs={(0, 1), (2, 1)}) >>> d4 = DAG(arcs={(1, 0), (1, 2)}) >>> d1.markov_equivalent(d2) True >>> d2.markov_equivalent(d1) True >>> d1.markov_equivalent(d3) False >>> d1.markov_equivalent(d2, [{2}]) False >>> d1.markov_equivalent(d4, [{2}]) True