# Bayesian Networks

## with Examples in R

M. Scutari and J.-B. Denis (2014).

Texts in Statistical Science, Chapman & Hall/CRC.

ISBN-10: 1482225581

ISBN-13: 978-1482225587

CRC Website

Amazon Website

The web page for the 2nd edition of this book is here.

## Errata Corrige

**page 15:**in equation (1.11), “*n*” should be just “_{tek}/n*n*”, otherwise the expression defines mutual information instead of the G_{tek}^{2}test.**page 16:**the correct result for`ci.test("T", "E", c("O", "R"), test = "x2", data = survey)`

is`8.24`

for the test statistic and`0.4106`

for the p-value.**page 17:**the correct result for`ci.test("T", "O", "R", test = "x2", data = survey)`

is`3.7988`

for the test statistic and`0.4339`

for the p-value.**page 17:**“`E x T`

” and “`O x T`

” (which denote two-dimensional contingency tables) can be better read as “`E → T`

” and “`O → T`

” (the arcs from which the contingency tables arise).**page 39:**in Figure 2.1,`C`

|`N`

~*N*(...) should be`C`

|`N`

,`W`

~*N*(...).**page 43:**in Table 2.1, “07*v*” should be “0.7*v*” in the probability distribution of`W`

|`C`

.**page 90:**at the end of the`R`

code snippet, the value returned by the last command should be`TRUE`

and not`"Different arc sets"`

.**page 99:**“α_{ij}+ n_{ijk}” in Equation (4.16) should be “α_{ijk}+ n_{ijk}”.**page 105:**the sentence “As a result, the marginal dependence test between`V`

and`N`

is significant at α = 0.05 while the same test conditional on`C`

is not.” should be phrased the other way round, since the marginal test is not significant while the conditional test is significant.**page 116:**“`joung`

” should be “`young`

” in the R code.**page 129:**the output of`compare()`

reports`tp`

,`fp`

and`fn`

equal to`1`

,`4`

and`8`

, which is incorrect. They should be equal to`0`

,`5`

and`9`

.**page 148:**the output`"Different number of directed/undirected arcs"`

is incorrect, it should be`TRUE`

since`avg.boot`

and`avg.start`

are equivalent.**page 211:**the solution to the last point of Exercise 4.3 is missing. It should read:for (size in c(0.005, 0.01, 0.1, 0.5, 1)) { subset = sample(nrow(survey), nrow(survey) * size) subsample = survey[subset, ] print(score(dag.hc3, subsample, type = "bic") / score(dag.hc3, subsample, type = "bde")) }#FOR

## Reference Versions of the Relevant R Packages

The following R packages were used (or at least mentioned) in the book. The reference version used in the writing of the book and a link to the CRAN/BioConductor homepage are reported for each package.

**Rgraphviz**version 2.4.1 [ BioConductor ]**graph**version 1.38.3 [ BioConductor ]**igraph**version 0.7.1 [ CRAN ]**bnlearn**version 3.5 [ CRAN ]**grBase**version 1.6-12 [ CRAN ]**gRain**version 1.2-2 [ CRAN ]**catnet**version 1.14.2 [ CRAN ]

## R Code and Data Files

## Table of Contents

### The Discrete Case: Multinomial Bayesian Networks

- Introductory Example: Train Use Survey
- Graphical Representation
- Probabilistic Representation
- Estimating the Parameters: Conditional Probability Tables
- Learning the DAG Structure: Tests and Scores
- Conditional Independence Tests
- Network Scores

- Using Discrete BNs
- Using the DAG Structure
- Using the Conditional Probability Tables
- Exact Inference
- Approximate Inference

- Plotting BNs
- Plotting DAGs
- Conditional Probability Distributions

- Further Reading

### The Continuous Case: Gaussian Bayesian Networks

- Introductory Example: Crop Analysis
- Graphical Representation
- Probabilistic Representation
- Estimating the Parameters: Correlation Coefficients
- Learning the DAG Structure
- Conditional Independence Tests
- Network Scores

- Using Gaussian Bayesian Networks
- Exact Inference
- Approximate Inference

- Plotting Gaussian Bayesian Networks
- Plotting DAGs
- Plotting Conditional Probability Distributions

- More Properties
- Further Reading

### More Complex Cases: Hybrid Bayesian Networks

- Introductory Example: Reinforcing Steel Rods
- Mixing Discrete and Continuous Variables
- Discretising Continuous Variables
- Using Different Probability Distributions

- Pest Example with JAGS
- Modelling
- Exploring

- About BUGS
- Further Reading

- Introductory Example: Reinforcing Steel Rods
### Theory and Algorithms for Bayesian Networks

- Conditional Independence and Graphical Separation
- Bayesian Networks
- Markov Blankets
- Moral Graphs
- Bayesian Network Learning
- Structure Learning
- Constraint-based Algorithms
- Score-based Algorithms
- Hybrid Algorithms

- Parameter Learning

- Structure Learning
- Bayesian Network Inference
- Probabilistic Reasoning and Evidence
- Algorithms for Belief Updating

- Causal Bayesian Networks
- Further Reading

### Software for Bayesian Networks

- An Overview of R Packages
- The
**deal**package - The
**catnet**package - The
**pcalg**package

- The
- BUGS Software Packages
- Probability Distributions
- Complex Dependencies
- Inference Based on MCMC Sampling

- Other Software Packages
- BayesiaLab
- Hugin
- GeNIe

- An Overview of R Packages
### Real-World Applications of Bayesian Networks

- Learning Protein-Signalling Networks
- A Gaussian Bayesian Network
- Discretising Gene Expressions
- Model Averaging
- Choosing the Significance Threshold
- Handling Interventional Data
- Querying the Network

- Predicting the Boby Composition
- Aim of the Study
- Designing the Predictive Approach
- Assessing the Quality of a Predictor
- The Saturated BN
- Convenient BNs

- Looking for Candidate BNs

- Further Reading

- Learning Protein-Signalling Networks

### Graph Theory

- Graphs, Nodes and Arcs
- The Structure of a Graph
- Further Reading

### Probability Distributions

- General Features
- Marginal and Conditional Distributions
- Discrete Distributions
- Continuous Distributions
- Conjugate Distributions
- Further Reading

### A Note About Bayesian Networks