14

Does anyone know of some well written code (in Matlab or R) for reversible jump MCMC? Preferably a simple demo application to compliment papers on the subject, that would be useful in understanding the process.

Comp_Warrior
  • 2,075
  • 1
  • 20
  • 35
Nick
  • 3,327
  • 6
  • 28
  • 24
  • There's been discussion of adding reversible jump MCMC to OpenBUGS per page 288 of *The BUGS Book* and WinBUGS has, I believe, a Jump module. Anyone heard of any similar development for JAGS? Is there some way of writing JAGS code to get the effect of doing the varying dimensionality? Is it simply a matter of defining dimensions larger than needed? – Jan Galkowski Jan 14 '14 at 20:13

5 Answers5

12

RJMCMC was introduced by Peter Green in a 1995 paper that is a citation classic. He wrote a Fortran program called AutoRJ for automatic RJMCMC; his page on this links to David Hastie's C program AutoMix. There's a list of freely available software for various RJMCMC algorithms in Table 1 of a 2005 paper by Scott Sisson. A Google search also finds some pseudocode from a group at the University of Glasgow that may be useful in understanding the principles if you want to program it yourself.

onestop
  • 16,816
  • 2
  • 53
  • 83
7

The book Bayesian Analysis for Population Ecology by King et al. describes RJMCMC in the context of population ecology. I found there description very clear and they provide the R code in the appendix.

The book also has an associated webpage, but some of the code found in the book isn't on the website.

csgillespie
  • 11,849
  • 9
  • 56
  • 85
  • they provide the WinBUGS code for RJMCMC? So, WinBUGS is capable of RJMCMC? – Tomas Jan 22 '13 at 19:04
  • 1
    @Tomas Someone edited my answer and changed R to WinBUGS. From what I recall, the book provides R code. – csgillespie Jan 22 '13 at 21:30
  • Thank you. (+1) Btw, did you find RJMCMC useful for population ecology? I didn't yet found any example where it could be useful.. I can always use data augmentation for example with standard MCMC and it does the job for me. Note that I don't have the book.. is it good? – Tomas Jan 22 '13 at 22:38
  • @Tomas The book uses RJMCMC for model choice. I found the description quite nice. I've needed to use RJMCMC in anger though. – csgillespie Jan 23 '13 at 08:50
  • "in anger"?? What do you mean? – Tomas Jan 23 '13 at 10:45
  • @Tomas "in anger" == "a real problem". Oh, my comment should say "never needed to use" – csgillespie Jan 23 '13 at 10:51
  • Thanks, my English is limited :) BTW, do you find this book worth buying? I would be especially interested in comparison with this book: [Bayesian Population Analysis using WinBUGS: A hierarchical perspective](http://www.amazon.com/Bayesian-Population-Analysis-using-WinBUGS/dp/0123870208), which I have and is perfect. If you can compare of course. – Tomas Jan 23 '13 at 11:07
  • Yes, I quite liked the King book. I've never read the WinBUGS book. – csgillespie Jan 23 '13 at 11:11
1

Just add one detail to @onestop's answer: I find the C software released by Olivier Cappé (CT/RJ MCMC) is very helpful to understand the Reversible jump MCMC algorithm (in particular how to design the probabilities for the birth-death and split-merge moves). The link to the source code is: http://perso.telecom-paristech.fr/~cappe/Code/CTRJ_mix/About/

Xiangju
  • 11
  • 1
1

Jailin Ai gives a fairly nice presentation of RJ MCMC together (though it hews very closely to Green's original paper) with attendant R code as part of his master's thesis at Leeds. Also gives an in-depth example of change-point problems, which are also included in Green's 1995 paper.

Find the thesis and the code here:

http://www1.maths.leeds.ac.uk/~voss/projects/2011-RJMCMC/

0

Nando de Freitas provides demos on the use of reversible jump MCMC algorithm for neural network parameter estimation. This model treats the number of neurons, model parameters, regularization parameters and noise parameters as random variables to be estimated.

The code and the write-up are available here: http://www.cs.ubc.ca/~nando/software.html

Vadim Smolyakov
  • 878
  • 6
  • 25