Biology Reference
In-Depth Information
3 ALG continuous()
4 ANL continuous()
5 STAT continuous()
However, not only it is not possible to recreate the undirected graph from Whittaker
( 1990 ), but the only way to specify the DAG from Fig. 2.2 is through the same model
string representation used in bnlearn .
> m = paste("[MECH][VECT|MECH][ALG|MECH:VECT]",
+ "[ANL|ALG][STAT|ALG:ANL]", sep = "")
> deal.net = as.network(m, deal.net)
> deal.net
## 5 ( 0 discrete+ 5 ) nodes;score= NA ;relscore=
1
MECH continuous()
2
VECT continuous()
1
3
ALG continuous()
1
2
4 ANL continuous() 3
5 STAT continuous() 3 4
Package catnet on the other hand is able to import a network structure from any
graphNEL object, making interoperation with pcalg easy, or through a list con-
taining the parents of each node, as shown in the code below.
> library(catnet)
> cat.net = cnCatnetFromEdges(names(marks),
+
list(MECH = NULL, VECT = "MECH",
+
ALG = c("MECH", "VECT"), ANL = "ALG",
+
STAT = c("ALG", "ANL")))
> cat.net
A catNetwork object with 5 nodes, 2 parents,
2 categories, Likelihood = 0 , Complexity = 13 .
For both packages, other quantities of interest have to be derived manually from
the information stored in the respective classes. For example, the Markov blanket of
VECT can be constructed in catnet using the functions cnEdges and cnParents
as follows:
> chld = cnEdges(cat.net)$VECT
> par = cnParents(cat.net)$VECT
> o.par = sapply(chld,
+ function(node) { cnEdges(cat.net)[[node]] })
> unique(unlist(c(chld, par, o.par[o.par != "VECT"])))
[1] "MECH" "ALG"
Search WWH ::




Custom Search