montepython_public icon indicating copy to clipboard operation
montepython_public copied to clipboard

add ultranest and snowline samplers

Open JohannesBuchner opened this issue 2 years ago • 3 comments

This is a work-in-progress to add two more samplers:

  1. https://johannesbuchner.github.io/UltraNest/ is a nested sampler that can be operated in two modes: (1) with MLFriends, a parameter-free safe algorithm, efficient in low dimensions and (2) with slice-sampling.
  2. https://johannesbuchner.github.io/snowline/ combines a optimizer (iminuit) with importance sampling.

The commits provide some basic documentation, and allows sampling.

Reading the output posteriors and evidence still needs work.

Please let me know if you are interested in merging this in principle.

JohannesBuchner avatar Feb 26 '23 09:02 JohannesBuchner

Dear Johannes,

I'd love to have these added to MontePython! As a frequent user of MultiNest I'm particularly interested in getting UltraNest added. Do you need any help from our side?

Best, Thejs

brinckmann avatar Feb 27 '23 13:02 brinckmann

Great!

Yes, if you could handle how to deal with the UltraNest output? I did not touch "from_NS_output_to_chains"

The PR works for me to run the sampling to completion.

sampler.run() gives you all the results (posterior samples, evidence, etc) directly. Alternatively you can read them from the output files (similar to multinest's).

Snowline works the same way, you get results['samples'], results['logz'], results['logzerr']. Snowline does not store to disk by itself.

Documentation of output files: https://johannesbuchner.github.io/UltraNest/performance.html#output-files

Doc of the returned results keys: Number of nested sampling iterations (niter), Evidence estimate (logz), Effective Sample Size (ess), H (information gain), weighted samples (weighted_samples), equally weighted samples (samples), best-fit point information (maximum_likelihood), posterior summaries (posterior). https://johannesbuchner.github.io/UltraNest/ultranest.html#ultranest.netiter.combine_results

JohannesBuchner avatar Feb 27 '23 13:02 JohannesBuchner

Hi, I just updated this to be compatible with the master branch. This is ready to be merged.

JohannesBuchner avatar Jul 10 '23 09:07 JohannesBuchner