montepython_public
montepython_public copied to clipboard
add ultranest and snowline samplers
This is a work-in-progress to add two more samplers:
- 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.
- 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.
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
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
Hi, I just updated this to be compatible with the master branch. This is ready to be merged.