running MCMC for too long…
Here is an excerpt from an email I just received from a young astronomer with whom I have had many email exchanges about the nature and implementation of MCMC algorithms, not making my point apparently:
The acceptance ratio turn to be good if I used (imposed by me) smaller numbers of iterations. What I think I am doing wrong is the convergence criteria. I am not stopping when I should stop.
To which I replied he should come (or Skype) and talk with me as I cannot get into enough details to point out his analysis is wrong… It may be the case that the MCMC algorithm finds a first mode, explores its neighbourhood (hence a good acceptance rate and green signals for convergence), then wanders away, attracted by other modes. It may also be the case the code has mistakes. Anyway, you cannot stop a (basic) MCMC algorithm too late or let it run for too long! (Disclaimer: the picture of an observatory seen from across Brunel’s suspension bridge in Bristol is unrelated to the young astronomer!)
December 6, 2013 at 8:23 am
Incidentally, Christian’s statement, that “…you cannot stop a (basic) MCMC algorithm too late or let it run for too long!”
has at least two interpretations. One is the correct one: there is no such thing as running an MCMC algorithm for too long. The other is the one that fooled me into thinking I was doing something wrong by running my chains longer and longer: You should not run the algorithm for too long.
I guess that for the majority of the audience of this blog, the wrong interpretation would not even arise as a possibility, but for a newcomer to MCMC like me, it left me burning cycles, especially given that the BADASS book by Gelman et al 2014 recommends just running the algorithm for longer if the chains don’t mix well (the Gelman-Rubin diagnostic). I was fooled into thinking that maybe there are some basic cases where one should not run it for too long…
October 22, 2013 at 10:19 pm
To follow on from a comment in a different thread, you can spin section 4 of this paper http://arxiv.org/pdf/1205.6857.pdf and ideas about floating point error to argue that you definitely shouldn’t run your MCMC chain for too long….
If you’re outside the regime that Rosenthal etc considered in those 2 papers on this, you may not even have an ergodic chain (let alone a correct one.
(This is, of course, somewhat of a straw-man)
October 22, 2013 at 12:57 pm
It might also be worth advertising here the ASAIP forum which includes a help board for astro-statistical questions: https://asaip.psu.edu/forums
October 22, 2013 at 6:11 pm
Thank you: the sequel to the story is coming tomorrow and is quite interesting!
October 20, 2013 at 3:14 pm
You’re right in theory, of course. In practice, plenty of people define Bayesian models with improper priors for which the posterior is also improper. When they run MCMC for not too long, they may get what looks like a reasonable answer. But of course the chain will diverge to infinity (or other ridiculous point) if they run if for a long time….
I think a simple program bug is probably the more likely explanation for the young astronomer’s problem, however.
October 20, 2013 at 6:41 pm
Thanks for the very relevant remark. I am afraid my correspondent is not at a level to implement BUGS (or Jags or Stan…)
In Machine Learning, a probabilistic perspective, which review will be posted tomorrow, Kevin Murphy also argues that the original Gibbs sampler of Geman and Geman (1984) had poor mixing properties and would not have converged if run long enough.