joshspeagle / dynesty

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

make likelihood condition strictly increasing #203

Closed ColmTalbot closed 4 years ago

ColmTalbot commented 4 years ago

Closes https://github.com/joshspeagle/dynesty/issues/202

ColmTalbot commented 4 years ago

It looks like all the remaining >= are safe

$ grep ">=" dynesty/*.py                                                                                                                                                                    (dev) 
dynesty/dynamicsampler.py:                    if worst >= 0:
dynesty/plotting.py:                in_bounds *= ((x >= span[i][0]) & (x <= span[i][1]))
dynesty/plotting.py:                in_bounds *= ((y >= span[j][0]) & (y <= span[j][1]))
dynesty/plotting.py:        if it >= nsamps:
dynesty/plotting.py:        if idx >= nsamps:
dynesty/plotting.py:        if it >= nsamps:
dynesty/plotting.py:        if idx >= nsamps:
dynesty/results.py:    if logzvar >= 0. and logzvar <= 1e6:
dynesty/sampler.py:            ucheck = ncall >= self.update_interval * (1 + nupdate)
dynesty/sampler.py:            ucheck = self.since_update >= self.update_interval
dynesty/utils.py:        nlive_flag[1:] = np.diff(samples_n) >= 0
ColmTalbot commented 4 years ago

I'm not entirely sure whether the changes to the slice sampling are necessary, I'm happy to undo them if you like.