Overview of this book

Learning Bayesian Models with R
Credits
www.PacktPub.com
Preface
Free Chapter
Introducing the Probability Theory
The R Environment
Introducing Bayesian Inference
Machine Learning Using Bayesian Inference
Bayesian Regression Models
Bayesian Classification Models
Bayesian Models for Unsupervised Learning
Bayesian Neural Networks
Bayesian Modeling at Big Data Scale
Index

Simulation of the posterior distribution

If one wants to find out the posterior of the model parameters, the `sim( )` function of the arm package becomes handy. The following R script will simulate the posterior distribution of parameters and produce a set of histograms:

```>posterior.bayes <- as.data.frame(coef(sim(fit.bayes)))
>attach(posterior.bayes)

>h1 <- ggplot(data = posterior.bayes,aes(x = X1)) + geom_histogram() + ggtitle("Histogram X1")
>h2 <- ggplot(data = posterior.bayes,aes(x = X2)) + geom_histogram() + ggtitle("Histogram X2")
>h3 <- ggplot(data = posterior.bayes,aes(x = X3)) + geom_histogram() + ggtitle("Histogram X3")
>h4 <- ggplot(data = posterior.bayes,aes(x = X4)) + geom_histogram() + ggtitle("Histogram X4")
>h5 <- ggplot(data = posterior.bayes,aes(x = X5)) + geom_histogram() + ggtitle("Histogram X5")
>h7 <- ggplot(data = posterior.bayes,aes(x = X7)) + geom_histogram() + ggtitle("Histogram X7")
>grid.arrange(h1,h2,h3,h4,h5,h7,nrow...```