Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ultranest and snowline samplers #315

Open
wants to merge 5 commits into
base: 3.5
Choose a base branch
from

Conversation

JohannesBuchner
Copy link

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.

@brinckmann
Copy link
Owner

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

@JohannesBuchner
Copy link
Author

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

@brinckmann brinckmann added the enhancement New feature or request label May 29, 2023
@JohannesBuchner
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants