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
andB
are d-separated givenC
, 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
- 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