Chapter 7

Inferring a Binomial Proportion via the Metropolis Algorithm

Contents

7.1 A Simple Case of the Metropolis Algorithm

7.1.1 A Politician Stumbles on the Metropolis Algorithm

7.1.2 A Random Walk

7.1.3 General Properties of a Random Walk

7.1.4 Why We Care

7.1.5 Why It Works

7.2 The Metropolis Algorithm More Generally

7.2.1 “Burn-in,” Efficiency, and Convergence

7.2.2 Terminology: Markov Chain Monte Carlo

7.3 From the Sampled Posterior to the Three Goals

7.3.1 Estimation

7.3.2 Prediction

7.3.3 Model Comparison: Estimation of p(D) 137

7.4 MCMC in BUGS

7.4.1 Parameter Estimation with BUGS

7.4.2 BUGS for Prediction

7.4.3 BUGS for Model Comparison

7.5 Conclusion

7.6 R Code

7.6.1 R Code for a Home-Grown Metropolis Algorithm

7.7 Exercises

You furtive ...

Get Doing Bayesian Data Analysis now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.