Chapter 6Assessing Mcmc Performance in WinBUGS
6.1 Convergence Issues in MCMC Modeling
We seek to avoid wrong conclusions when we send our Markov chains out to map the posterior distributions of our model's parameters. However, our challenge is that we usually will not know what results to expect in advance. Therefore, we will typically not have a known “gold standard” distribution to compare with the distribution arising from our MCMC run. This motivates the use of diagnostic analyses to assess the performance of the Markov chain. Our primary tool so far has been the trace plot, and so far the Markov chains seem to be performing reasonably well in producing samples from the posterior distributions of our parameters after a brief burn-in period. Of course, this does not always occur. For a variety of reasons, we may find that the output of the Markov chain gives us reason for concern. Consider the following WinBUGS code (see also the file WinBUGS Code 6.1 poor convergence.odc):
model
{
#likelihood + functional form
for (i in 1:n)
{y[i] ~ dnorm(mu, 1)}
mu <- bad1 + bad2
#priors and calculated parameters
bad1 ~ dnorm(0, 0.0000001)
bad2 ~ dnorm(0, 0.0000001)
}
#data
list(y=c(100, 102), n=2)
#inits
list(bad1=1,bad2=1)
After allowing a burn-in of 1000 iterations, we sample from the posteriors for 10,000 iterations. A plot of the traces of bad1
and bad2
appears in Figure 6.1.
Get Bayesian Methods for Management and Business: Pragmatic Solutions for Real Problems now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.