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 | sequence of int) – a sequence of node ids (int) or a single node id (int)

  • Y (int | sequence of int) – a sequence of node ids (int) or a single node id (int)

  • Z (int | sequence of int (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:

See also

pyagrum.graph.separation

the 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

ChainGraph