ABSTRACT

This chapter introduces a general class of algorithms, collectively called Markov chain Monte Carlo (MCMC), that can be used to simulate the posterior from general Bayesian models. These algorithms are based on a general probability model called a Markov chain. The chapter describes this probability model for situations where the possible models are finite. It introduces the Metropolis sampler, a general algorithm for simulating from an arbitrary posterior distribution, and describes the implementation of this simulation algorithm for the normal sampling problem with a Cauchy prior. The chapter discusses another MCMC simulation algorithm, Gibbs sampling, that is well-suited for simulation from posterior distributions of many parameters. It describes some common diagnostic methods for seeing if the simulated sample is a suitable exploration of the posterior distribution. The chapter illustrates the use of a general-purpose software program Just Another Gibbs Sampler and R interface for implementing these MCMC algorithms.