Skip to main content

Test m-separation

Source: R/identification.R

Description

Generalizes d-separation to graphs with bidirected and undirected edges; for a DAG, m-separation is equivalent to d_separated(). For a PAG, circle marks collapse to tails, as for possible_ancestors().

Usage

m_separated(cg, x, y, given = character())

Arguments

cg A DAG, ADMG, AG-family (AG, MAG), or PAG graph created with cgraph().
x, y Node name, or character vector of node names (to test whether the two sets are separated).
given Character vector of conditioning node names (may be empty).

Value

TRUE if x and y are m-separated given given.

Examples

admg <- cgraph(A %-->% B, A %<->% C, class = "ADMG")
m_separated(admg, "B", "C") # bidirected edge at A connects
#> [1] FALSE
m_separated(admg, "B", "C", "A") # conditioning on A blocks
#> [1] TRUE

pag <- cgraph(A %o->% B, C %o->% B, class = "PAG")
m_separated(pag, "A", "C")
#> [1] TRUE