joshspeagle / dynesty

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

Map the transformed u value in rwalk, either periodically, or reflect #129

Closed GregoryAshton closed 5 years ago

GregoryAshton commented 5 years ago

This is an initial suggestion for how to close #128. This lets the u wander outside the unit cube, then applies the logic to map it back in based on if the parameter is periodic or not. Periodic parameters get wrapped around the unit cube, 1.1 -> 0.1, while reflective (all non-periodic parameters) get reflected, e.g 1.1 -> 0.9.

This is suggested as a "work in progress", I'd guess it needs implementing in all the other proposal methods so they have similar behaviours, but I thought I'd just put something initial in to see what you thought. This also makes some of the periodic checking code obsolete I think.

joshspeagle commented 5 years ago

This looks great! Merging this in. I'll also try and add this code snippet in to rstagger.