johannesulf / nautilus

Neural Network-Boosted Importance Nested Sampling for Bayesian Statistics
https://nautilus-sampler.readthedocs.io
MIT License
73 stars 8 forks source link

optimization with flat likelihood for a range of free parameters #44

Closed simoncasassus closed 8 months ago

simoncasassus commented 8 months ago

hi Johannes, Nautilus has been working great for me, but I am now on a problem where it is getting stuck. In its simplest expression, the optimization is for a 2D problem. I am using 3000 live points, and Nautilus gets stuck right after having filled bound 17. I noticed that this is when the log-likelihood values are constant, while the free parameters vary in a narrow range of +-1/1000 the best fit values (which are indeed the correct values, normalized to vary between 0 and 1). So in my problem chi2 is constant when the free parameters vary only by one thousandth, because of data pixelization. Is there a way to inform the Nautilus optimization of this limit, so that it does not get stuck trying to refine free-parameters below one-thousandth (for instance)? Thanks!! PS: the same optimization works OK with dynesty, with a coarse dlogz.

johannesulf commented 8 months ago

Thanks for reaching out and for writing the detailed report. Can you tell me which version of nautilus you used? Ideally, what you're describing shouldn't result in the optimization getting stuck. At least with the most recent version. I'd be very happy to look at this problem once you verify it happens with nautilus version 1.0.2. In order for me to troubleshoot this problem, a minimal working example would be best. Alternatively (but less optimal), you could send me a checkpoint file of the run right before it gets stuck.

simoncasassus commented 8 months ago

hi Johannes, thank you very much for your prompt reply. I was running on 0.7. I have now upgraded to 1.0.2, and it works perfectly well - and hugely faster than dynesty!

johannesulf commented 8 months ago

Wonderful! I recently made various improvements when dealing with plateaus. I previously hadn't thought much about how to handle them. I also implemented automatic checks for likelihoods with plateaus. So I hope everything works well now. But please let me know if you encounter any issues.