This chapter provides a brief introduction to the use of Bayesian graphical models in R. In these models, parameters are treated as random quantities on an equal footing with the random variables. This allows complex stochastic systems to modeled, often using Markov chain Monte Carlo (MCMC) sampling methods. We first consider a series of examples, ranging from simple repeated sampling, linear regression models, random coefficient regression models, to the chest clinic example of Chap. 3. We formulate these as Bayesian graphical models, and represent them graphically in a compact form using plates. We then describe a special case, in which the unknown parameters are all discrete, and explain how probability propagation methods described in Chap. 3 may be used to compute the posterior distributions. We then turn to the general case, when MCMC sampling is required, and explain the computations involved in Metropolis-Hastings sampling and Gibbs sampling. Finally we illustrate a Bayesian linear regression analysis using the R2WinBUGS package.
[1]
A. Dawid,et al.
Hyper Markov Laws in the Statistical Analysis of Decomposable Graphical Models
,
1993
.
[2]
David J. Spiegelhalter,et al.
WinBUGS user manual version 1.4
,
2003
.
[3]
Walter R. Gilks,et al.
A Language and Program for Complex Bayesian Modelling
,
1994
.
[4]
Jim Albert,et al.
Bayesian Computation with R
,
2008
.
[5]
Andrew Gelman,et al.
R2WinBUGS: A Package for Running WinBUGS from R
,
2005
.
[6]
David J. Spiegelhalter,et al.
Sequential updating of conditional probabilities on directed graphical structures
,
1990,
Networks.