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.
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.
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.
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/
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:
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