Biology Reference
In-Depth Information
Original Graphical Model (UG)
Bayesian Network (DAG)
Equivalence Class (CPDAG)
S TAT
S TAT
STAT
ANL
ANL
ANL
ALG
ALG
ALG
MECH
MECH
MECH
VECT
VECT
VECT
Fig. 2.2
The undirected graphical model for the
marks
data set from
Edwards
(
2000
)and
Whit-
taker
(
1990
)(
left
), the Bayesian network learned from the same data (
center
), and the CPDAG of
its equivalence class (
right
)
average branching factor:
1.20
generation algorithm:
Empty
Rather than typing the arcs of the network in a two-column format, we can also
create
ug
starting from an adjacency matrix as follows:
> mat = matrix(c(0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0,
+
0,1,1,0,0,0,0,1,0,0,0,0,0),
+
nrow = 5,
+
dimnames = list(nodes(dag), nodes(dag)))
> mat
MECH VECT ALG ANL STAT
MECH 0 0 0 0 0
VECT 1 0 0 0 0
ALG 1 1 0 0 0
ANL 0 0 1 0 0
STAT 0 0 1 1 0
> dag2 = empty.graph(nodes(dag))
> amat(dag2) = mat
> all.equal(dag, dag2)
[1] TRUE
On the other hand, sometimes we may just want to create a new
bn
object by modi-
fying an existing one. The most straightforward way to accomplish this is by adding
(
set.arc
), dropping (
drop.arc
), or reversing (
rev.arc
) arcs in the original
network.
Search WWH ::
Custom Search