joshspeagle / dynesty

Dynamic Nested Sampling package for computing Bayesian posteriors and evidences
https://dynesty.readthedocs.io/
MIT License
347 stars 76 forks source link

add number of effective posterior samples as a stopping condition #135

Closed ColmTalbot closed 5 years ago

ColmTalbot commented 5 years ago

Hi @joshspeagle, this PR adds an additional stopping condition that a certain number of posterior samples have been generated.

This is something we're looking at using in Bilby for gravitational-wave analysis where we want to get a decent number of samples in the shortest time possible. It would be great if you think this is useful enough to merge into master.

This relies on the Kish effective sample size.

joshspeagle commented 5 years ago

This looks pretty reasonable as a stopping condition. I’ll plan to merge this in soon and then try to rework things a bit so that this can hopefully be applied both to Static and Dynamic Nested Sampling runs.

ColmTalbot commented 5 years ago

Great! Let me know if there are any changes you'd like to make.

joshspeagle commented 5 years ago

Nothing major that should require any edits on your end. My plan was just to reorganize the structure slightly to better match the other stopping conditions and possible flags (like adding the final live points and use with the generator). Then, I just wanted to add this in for the dynamic nested sampler as an alternate choice over the KLD error currently used, since it appears to make sense in that context.

Hoping to get to this sometime later this week while I deal with the final dynesty referee report, which also requested code changes.