ChainGraph.cSeparation
- ChainGraph.cSeparation(*args)
Check if the sets of nodes X and Y are c-separated (by the set of nodes Z if given) in the chain graph (LWF interpretation).
- Parameters:
X (
int | sequenceofint) – a sequence of node ids (int) or a single node id (int)Y (
int | sequenceofint) – a sequence of node ids (int) or a single node id (int)Z (
int | sequenceofint (optional)) – a sequence of node ids (int) or a single node id (int)
- Returns:
True if X and Y are c-separated (by Z if given), False otherwise.
- Return type:
bool- Raises:
pyagrum.InvalidArgument – if X and Y are not disjoint
pyagrum.InvalidNode – if a node of X, Y or Z is not a node of the chain graph
See also
pyagrum.graph.separationthe separation criterion of each kind of graph
Example
import pyagrum as gum
cg = gum.fastChainGraph("A->B-C;D->C")
cg.cSeparation(0, 3) # A and D are c-separated
# True
cg.cSeparation(0, 3, 2) # but not given C
# False
Class