ABSTRACT

As discussed in Chapter 3, the posterior distribution contains all the information needed for Bayesian inference. In all of the examples encountered thus far there is a single unknown parameter, whose posterior distribution might be graphed to provide a complete picture of the current state of knowledge arising from the data and prior information. More generally, though, we wish to calculate numeric summaries of the posterior distribution via integration, e.g., E[θ|y] = ∫

θ θp(θ|y) dθ. In the conjugate examples considered so far, the

posterior distribution is available in closed form and so the required integrals are straightforward to evaluate. However, outside the conjugate family of models, the posterior is usually of non-standard form (although we can always write down its density function to within a constant of proportionality). As a consequence, at least some of the integrals required for summarising the distribution are difficult. Various methods are available for evaluating such integrals. In cases where

we can sample directly from the posterior, such as in conjugate problems, we could use Monte Carlo simulation (if we wished to venture beyond standard results). More generally, however, we could try to obtain an approximation to the posterior density that is analytically tractable, for example, assuming asymptotic normality of the posterior or more complex techniques such as Laplace’s method (see, for example, Carlin and Louis (2008); Gelman et al. (2004) for further details). Alternatively, numerical integration methods can be used (Davis and Rabinowitz (1975); Press et al. (2002), Ch. 4). Standard techniques include Gaussian quadrature, or a form of (non-iterative) Monte Carlo integration, which differs from the form described in § 1.4. There we could obtain a direct sample from p(θ|y) — here we cannot, so we would integrate by sampling points uniformly from the region to be integrated over, averaging the values of the integrand at those points, finally multiplying by the size of the region. Here, however, we focus exclusively on the class of iterative methods known

The

as Markov chain Monte Carlo (MCMC) integration (Gelfand and Smith, 1990; Geman and Geman, 1984; Metropolis et al., 1953; Hastings, 1970). These are by far the most powerful and flexible class of algorithms available for Bayesian computation, though see § 4.6 for a brief discussion of situations where MCMC is not well suited. We first present an example in which the single parameter of interest has a non-standard posterior, to illustrate the ease with which complex integrals can be evaluated using MCMC in BUGS. Later, after discussing multi-parameter models, we will describe the types of MCMC algorithm used by BUGS for performing such computations.