Learn R Programming

MXM (version 0.9.3)

Markov Blanket of a node in a directed graph: Returns and plots, if asked, the Markov blanket of a node (or variable)

Description

Returns and plots, if asked, the Markov blanket of a node (or variable).

Usage

mb(G, node, graph = FALSE)

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)).
graph
A boolean variable. If TRUE the relevant graph will appear (if the Markov blanket is the non emty set).

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.

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.

See Also

plota, nei, pc.or

Examples

Run this code
# 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
plota(G)
dev.new()
mb(G, 8, graph = TRUE)

Run the code above in your browser using DataLab