graphical_models.classes.mags.ancestral_graph.AncestralGraph.legitimate_mark_changes
- AncestralGraph.legitimate_mark_changes(verbose=False, strict=True)[source]
Return directed edges that can be changed to bidirected edges, and bidirected edges that can be changed to directed edges.
- Parameters
verbose – If True, print each possible mark change and which condition it fails, if any.
strict – If True, check discriminating path condition. Otherwise, check only equality of parents and spouses.
- Returns
Directed edges that can be changed to bidirected edges, and bidirected edges that can be changed to directed edges (which will be the new directed edge).
- Return type
(mark_changes_dir, mark_changes_bidir)
Example
>>> from graphical_models import AncestralGraph >>> g = AncestralGraph(directed={(0, 1)}, bidirected={(1, 2)}) >>> g.legitimate_mark_changes() ({(0, 1)}, {(2, 1)})