joshspeagle / dynesty

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

unif sampling with multi bounds can generate out-of-bounds samples #176

Closed rory-smith closed 4 years ago

rory-smith commented 4 years ago

Hi Josh,

I'd like to understand better how I can modify dynesty to avoid the issue described in the subject heading. I assume that the bounding ellipses can go out of the bounds of the unit cube which can cause samples within the ellipses to also be out of bounds. I'd be grateful if you could point me to the right place to look to see where uniform samples are projected onto a bounding ellipse so I can play around with this.

Best, Rory

joshspeagle commented 4 years ago

Yes, this is indeed a possible issue and one dynesty deals with by (1) avoiding constructing the first ellipsoids until the points are reasonably far away from the edges and (2) automatically rejecting all out-of-bounds samples (except in cases where reflective or periodic bounds are enabled). The place where this occurs with the MultiEllipsoid sampler is here.