Learn R Programming

MXM (version 0.8.7)

mb: 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

  • parentsThe parents of the node of interest.
  • childrenThe children of the node of interest.
  • spousesThe spouses of the node of interest. These are the other parents of the children of the node of interest.
  • relativesNodes 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.blanketThe 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
mb(G, 1, graph = FALSE)

Run the code above in your browser using DataLab