Biology Reference
In-Depth Information
> dag3 = empty.graph(nodes(dag))
> dag3 = set.arc(dag3, "VECT", "MECH")
> dag3 = set.arc(dag3, "ALG", "MECH")
> dag3 = set.arc(dag3, "ALG", "VECT")
> dag3 = set.arc(dag3, "ANL", "ALG")
> dag3 = set.arc(dag3, "STAT", "ALG")
> dag3 = set.arc(dag3, "STAT", "ANL")
> all.equal(dag, dag3)
[1] TRUE
The approaches discussed above are guaranteed to result in directed or partially
DAGs unless check.cycles is explicitly set to FALSE . A quick check reveals
that the moral graph of dag and the graphical model from Whittaker ( 1990 ) express
the same dependence relationships, as expected.
> all.equal(ug, moral(dag))
[1] TRUE
Upon creating a bn object, we are in a position to investigate those properties of
the corresponding graph that have a probabilistic interpretation in a Bayesian net-
work. For this purpose, the bn class provides a complete description of the network
structure (which is uniquely specified by its arc set), and the use of the information
stored for each node results in significant performance improvements for common
operations.
For instance, when treating the network as a causal model we are often interested
in the topological ordering of the nodes. The relative position of two nodes in the
topological ordering is indicative of the direction of any possible causal relationship
between them, because it implies the direction of any possible path linking the nodes
(a more detailed explanation can be found in Sect. 2.4 ).
> node.ordering(dag)
[1] "STAT" "ANL" "ALG" "VECT" "MECH"
The neighborhood ( nbr ) and the Markov blanket ( mb ) of a node provide a syn-
thetic description of the local dependence structure around that node. These can be
obtained as follows:
> nbr(dag, "ANL")
[1] "ALG" "STAT"
> mb(dag, "ANL")
[1] "ALG" "STAT"
We can also use the commands above to show that both sets describe symmetric
relationships, i.e., if ALG is in the Markov blanket of ANL , ANL is in the Markov
blanket of ALG .
> "ANL" %in% mb(dag, "ALG")
[1] TRUE
> "ALG" %in% mb(dag, "ANL")
[1] TRUE
Search WWH ::




Custom Search