pints icon indicating copy to clipboard operation
pints copied to clipboard

Add option to allow tempering rather than mixing for SMC and population MCMC

Open ben18785 opened this issue 6 years ago • 3 comments

At the moment the series of intermediate distributions are different between SMC and populationMCMC. We should allow each to have the other's option and make the default the same between both.

  • SMC does a mixing: beta * log p(theta|x) + (1 - beta) * log p(theta),
  • PopulationMCMC does a tempering: beta * log p(theta|x)

In many cases, this won't make a difference if the priors are flat. If they aren't, however, it will affect performance, and so we want to allow both options, because we won't know what's best.

ben18785 avatar Aug 31 '18 16:08 ben18785

I kind of find both these not very useful. I would rather prefer beta*log p(x|theta) + log p(theta). This is the thermodynamic integral path and thus naturally gives me the marginal likelihood. I had to reimplement the populationMCMC just to get this. Do I need to implement a separate SMC just for the marginal likelihood ? I don't think that will be a wise design.

sanmitraghosh avatar Aug 31 '18 22:08 sanmitraghosh

@sanmitraghosh That's interesting and I think also something we should add (but I don't think it should be the default because that's not typically the default in other papers). To be clear, when you say you 'reimplement'ed populationMCMC, was this out of Pints? Just want to make sure the code is doing what I currently think it is doing, haha!

I agree returning the marginal likelihood (if possible) should be done. In Neal's AIS paper, he does this using, beta * log(theta|x) + (1-beta) * other, where 'other' could be the prior, so we could return the marginal likelihood in that case?

How can you do it in your case? I don't know how to do it in the tempering case.

My view is that, the marginal likelihood - whilst some find it useful - isn't the main purpose of Pints and so should have as default whichever algorithm we think is best for generating posterior samples. I think we should have all three options available to a user/for benchmarking though.

ben18785 avatar Sep 01 '18 01:09 ben18785

@ben18785 @MichaelClerx I want to quickly write down my final observations regarding this issue.

  1. I am happy as long as the tempering is either a) beta * log(theta|x) + (1-beta) * prior OR b) beta*log(x|theta) + log prior. Any other scheme in addition to these are welcome but scheme a) or b) needs to be there.

  2. Please implement marginal likelihood for the SMC, which is basically section 3.2.1 of the Del moral paper. This would require just a few lines of code in the SMC implementation.

  3. For PopMCMC it is required to get the likelihood values for each chain/beta(s). This is impossible with current infrastructure/design. So my advise is to leave it. Just sort out the tempering and we are good to go.

I must point out that I am not a huge fan of marginal likelihood either. But SMC sampler is famous for estimating it as a byproduct and thus I think at the least we should just return this quantity for SMC when the correct tempering (a OR b) is used.

sanmitraghosh avatar Feb 13 '19 12:02 sanmitraghosh