PolyStan: PolyChord nested sampling and Bayesian evidences for Stan models

Hi all,

You may find this interesting and useful, especially if your models are mulitmodal, have discrete parameters, or you want to compute marginal likelihoods,

PolyStan: PolyChord nested sampling and Bayesian evidences for Stan models

Sampling from multi-modal distributions and estimating marginal likelihoods, also known as evidences and normalizing constants, are well-known challenges in statistical computation. They can be overcome by nested sampling, which evolves a set of live points through a sequence of distributions upwards in likelihood. We introduce PolyStan – a nested sampling inference engine for Stan. PolyStan provides a Stan interface to the PolyChord nested sampling algorithm using bridgestan. PolyStan introduces a new user-base to nested sampling algorithms and provides a black-box method for sampling from challenging distributions and computing marginal likelihoods. We demonstrate the robustness of nested sampling on several degenerate and multi-modal problems, comparing it to bridge sampling and Hamiltonian Monte Carlo.

If so, you can get started on a simple example by

git clone --recursive https://github.com/xhep-lab/polystan
cd polystan
make examples/bernoulli 
./examples/bernoulli data --file examples/bernoulli.data.json

The code is here on github. Please give it a try and feel free to ask any questions here, to me by email or raise any issues on the issue tracker.

Kind regards,

Andrew

4 Likes

Cool and thanks for releasing and putting in a note here. @andrewgelman has a side interest in nested and bridge sampling, so I’m pinging him. We know HMC fails whenever there’s a big enough energy gap between the modes.

P.S. We’ve been happily surprised just how many people have found BridgeStan useful.

2 Likes

BridgeStan is great :)

I wasn’t surprised either that HMC struggled with multimodality, though I was surprised it failed on my spike-slab example. On the other hand, when it worked it was extremely efficient and when didn’t it produced warnings, so it never entirely failed.

I didn’t know that Andrew Gelman was interested in nested sampling or bridge sampling, or methods for computing marginal likelihoods.

Looking forward to further discussions & learning more. I hope you find PolyStan a useful tool.

Regarding path sampling etc., I recommend this paper: https://sites.stat.columbia.edu/gelman/research/unpublished/2009.00471.pdf