mb: Returns the Markov blanket of a node (or variable)

View source: R/mb.R

Markov Blanket of a node in a directed graphR Documentation

Returns the Markov blanket of a node (or variable)

Description

Returns the Markov blanket of a node (or variable).

Usage

mb(G, node)

Arguments

G

The graph matrix as produced from pc.or or any other algorithm which produces directed graphs.

node

A vector with one or more numbers indicating the seleted node(s) (or variable(s)).

Details

This is a way to see the network for some given nodes. It is useful if you have many nodes and the whole network is a bit difficult to see clearly. Bear in mind that the values can be extracted with the $ symbol, i.e. this is an S3 class output.

Value

parents

The parents of the node of interest.

children

The children of the node of interest.

spouses

The spouses of the node of interest. These are the other parents of the children of the node of interest.

relatives

Nodes which are connected with the node of interest, but it is not known whether they are parents or children. The edge between them is undirected.

markov.blanket

The Markov blanket of the node of interest. The collection of all the previous.

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr

See Also

plotnetwork, nei, pc.or

Examples

# simulate a dataset with continuous data
# simulate a dataset with continuous data
y <- rdag(1000, 10, 0.3)
tru <- y$G 
x <- y$x
mod <- pc.con(x)
G <- pc.or(mod)$G
plotnetwork(G)
dev.new()
mb(G, 8)

MXM documentation built on Aug. 25, 2022, 9:05 a.m.