Skip to main content

Markov blanket of a node

Source: R/queries.R, R/jlbind-wrappers.R

Description

Returns the Markov blanket of node in cg: the minimal set of nodes that renders node conditionally independent of every other node in the graph.

Usage

markov_blanket(cg, node)

Arguments

cg A DAG, PDAG-family (PDAG, CPDAG, MPDAG), ADMG, AG-family (AG, MAG), or PAG graph created with cgraph().
node Node name.

Details

Which nodes it contains depends on the graph class:

  • DAG: parents, children, and co-parents (other parents of node’s children).

  • PDAG-family (PDAG, CPDAG, MPDAG): the DAG set, plus undirected neighbors.

  • ADMG: the union of the parents of every node in node’s district (excluding node itself).

  • AG-family (AG, MAG): parents, children, co-parents, spouses, and undirected neighbors.

  • PAG: the AG-family set in the representative MAG of cg from mag_from_pag().

Value

Sorted character vector of node names.

Examples

dag <- cgraph(A %-->% B, B %-->% C, D %-->% C)
markov_blanket(dag, "B") # A, C, D (D is a co-parent)
#> [1] "A" "C" "D"
markov_blanket(dag, "C")
#> [1] "B" "D"