Skip to Main Content
Bayesian Networks
book

Bayesian Networks

by Marco Scutari, Jean-Baptiste Denis
June 2014
Intermediate to advanced content levelIntermediate to advanced
241 pages
6h 20m
English
CRC Press
Content preview from Bayesian Networks
6 Bayesian Networks: With Examples in R
bnlearn provides many other functions to investigate and manipulate bn
objects. For a comprehensive overview, we refer the reader to the documenta-
tion included in the package. Two basic examples are nodes and arcs.
> nodes(dag)
[1] "A" "S" "E" "O" "R" "T"
> arcs(dag)
from to
[1,] "A" "E"
[2,] "S" "E"
[3,] "E" "O"
[4,] "E" "R"
[5,] "O" "T"
[6,] "R" "T"
The latter function also provides a way to add arcs to a DAG that is faster
than setting them one at a time. Obviously, the approach we used above is too
cumbersome for large DAGs. Instead, we can create a matrix with the same
structure as that returned by arcs and set the whole arc set at once.
> dag2 <- empty.graph(nodes = c("A", "S", "E", "O", "R", "T"))
> arc.set
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Applications of Bayesian Reliability

Practical Applications of Bayesian Reliability

Yan Liu, Athula I. Abeyratne
Benefits of Bayesian Network Models

Benefits of Bayesian Network Models

Philippe Weber, Christophe Simon
Learning Bayesian Models with R

Learning Bayesian Models with R

Hari Manassery Koduvely

Publisher Resources

ISBN: 9781482225587