DoorCriteria.hasBackdoorPath
- static DoorCriteria.hasBackdoorPath(dag, X, Y, Z)
Test whether an open backdoor path from X to Y exists given evidence on Z.
- Parameters:
dag (
pyagrum.DAG) – The causal DAG.X (
int) – NodeId of the treatment variable.Y (
int) – NodeId of the outcome variable.Z (
setofint) – Conditioning set (NodeIds).
- Returns:
True if an open backdoor path from X to Y exists after conditioning on Z.
- Return type:
bool
Example
import pyagrum as gum
bn = gum.fastBN("Z->X->Y;Z->Y")
dag = bn.dag()
x, y, z = (bn.idFromName(n) for n in "XYZ")
gum.DoorCriteria.hasBackdoorPath(dag, x, y, set())
# True
gum.DoorCriteria.hasBackdoorPath(dag, x, y, {z}) # conditioning on Z blocks X<-Z->Y
# False
Class