JohannesBuchner / PyMultiNest

Pythonic Bayesian inference and visualization for the MultiNest Nested Sampling Algorithm and PyCuba's cubature algorithms.
http://johannesbuchner.github.io/PyMultiNest/
Other
191 stars 87 forks source link

Increasing the number of equal weight posterior samples #243

Closed HinLeung622 closed 6 months ago

HinLeung622 commented 6 months ago

This might be a naive question, but is there a way to increase the number of equal weight posterior samples outputted by multinest after the iterative sampling process? I noticed that in issue #32 it was mentioned that the total number of samples drawn (and not rejected) is not a parameter set by the user, but rather inferred from the number of live points and the various efficiency/acceptance/convergence thresholds. Is there a way to draw a number of samples from the posterior volume that is already inferred by the iterative importance sampling steps after convergence? Increasing the number of live points certainly is a way to increase the number of outputted equal weight posterior samples but my problem do not require more live points than currently specified, so increasing that will result in less efficient sampling. Feroz+2008 reads that the two main aspects affecting multinest are the number of live points and the maximum sampling efficiency. Would changing the maximum sampling efficiency help this issue?

My problem is a multi-modal parameter estimation problem with Ndim between 5 and 20.

Thanks very much.

JohannesBuchner commented 6 months ago

This is not something PyMultiNest does. I do not know exactly how it is implemented in MultiNest. The efficiency factor does not come in AFAIK.

What you have to care about is the effective sample size (ESS), formula at the end of this section https://en.wikipedia.org/wiki/Design_effect#Effective_sample_size. I guess MultiNest may compute the ESS and then draw an an appropriate number of equally weighted samples. Because even if you sampled more equally weighted samples from the weighted samples, you would not get more diversity. In nested sampling the ESS is directly related to the number of live points, so my recommendation is to run with more live points.

HinLeung622 commented 6 months ago

That makes sense, thanks very much! And special thanks for helping during the holiday season!