joshspeagle / dynesty

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

Refactor of jitter_run/utils #275

Closed segasai closed 3 years ago

segasai commented 3 years ago

I've started to take a stab at optimizing/understanding/clarifiying jitter_run.

I replaced all the numpy 'int' ,'bool' types by int, bool. I also separated the code that detects decrease in number of live-points. (I verified that it produces the same results).

I think I'd like to vectorize/clarify the jitter_run code, as currently it's a bit of a maze to me. It'd be also good to have some kind of references explaining the maths there...

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 885276029


Changes Missing Coverage Covered Lines Changed/Added Lines %
py/dynesty/utils.py 29 38 76.32%
<!-- Total: 29 38 76.32% -->
Totals Coverage Status
Change from base Build 883214612: 0.07%
Covered Lines: 3350
Relevant Lines: 4670

💛 - Coveralls
joshspeagle commented 3 years ago

As a quick reference if you'd like to pursue further vectorization, some of the math is outlined in Appendix A of the dynesty paper, in particular A.4 and A.5.

joshspeagle commented 3 years ago

Okay, this looks good to me. Pulling out the "check if live points are decreasing" part of the code into its own separate internal function is also a good change. Thanks.