graphical_models.classes.dags.dag.DAG.dsep

DAG.dsep(A: Union[Set[Hashable], Hashable], B: Union[Set[Hashable], Hashable], C: Union[Set[Hashable], Hashable] = {}, verbose=False, certify=False) bool[source]

Check if A and B are d-separated given C, using the Bayes ball algorithm.

Parameters
  • A – First set of nodes.

  • B – Second set of nodes.

  • C – Separating set of nodes.

  • verbose – If True, print moves of the algorithm.

See also

dsep_from_given

Return type

is_dsep

Example

>>> from graphical_models import DAG
>>> g = DAG(arcs={(1, 2), (3, 2)})
>>> g.dsep(1, 3)
True
>>> g.dsep(1, 3, 2)
False