Package: ultranest
UltraNestFit and compare complex models reliably and rapidly with advanced sampling techniques.Correctness. Speed. Ease of use. 🦔AboutWhen scientific models are compared to data, two tasks are important:
1) contraining the model parameters and 2) comparing the model to other models.
Different techniques have been developed to explore model parameter spaces.
This package implements a Monte Carlo technique called nested sampling.Nested samplingallows Bayesian inference on arbitrary user-defined likelihoods.
In particular, posterior probability distributions on model parameters
are constructed, and the marginal likelihood (“evidence”) Z is computed.
The former can be used to describe the parameter constraints of the data,
the latter can be used for model comparison (viaBayes factors)
as a measure of the prediction parsimony of a model.In the last decade, multiple variants of nested sampling have been
developed. These differ in how nested sampling finds better and
better fits while respecting the priors
(constrained likelihood prior sampling techniques), and whether it is
allowed to go back to worse fits and explore the parameter space more.This package develops novel, advanced techniques for both (SeeHow it works).
They are especially remarkable for being free of tuning parameters
and theoretically justified. Beyond that, UltraNest has support for
Big Data sets and high-performance computing applications.UltraNest is intended for fitting complex physical models with slow
likelihood evaluations, with one to hundreds of parameters.
UltraNest intends to replace heuristic methods like multi-ellipsoid
nested sampling and dynamic nested sampling with more rigorous methods.
UltraNest also attempts to provide feature parity compared to other packages
(such as MultiNest).You can help by testing UltraNest and reporting issues. Code contributions are welcome.
See theContributing page.FeaturesPythonicpip and conda installableEasy to program for: Sanity checks with meaningful errorsCan control the run programmatically and check statusReasonable defaults, but customizableThoroughly tested with many unit and integration testsNEW: supports likelihood functions written inPython,C,C++,Fortran,JuliaandRRobust exploration easily handles:Degenerate parameter spaces such as bananas or tight correlationsMultiple modes/solutions in the parameter spaceRobust, parameter-free MLFriends algorithm
(metric learning RadFriends, Buchner+14,+19), with new improvements
(region follows new live points, clustering improves metric iteratively,
NEW in v4.0: refined local metric).High-dimensional problems with hit-and-run samplingWrapped/circular parameters, derived parametersFast-slow parametersLightweight and fastsome functions implemented in Cythonvectorized likelihood function calls,
optimally supporting models with deep learning emulatorsUse multiple cores, fully parallelizable from laptops to computing clustersMPI supportAdvanced visualisation and crash recovery:Live view of the exploration for Jupyter notebooks and terminalsPublication-ready visualisationsCorner plots, run and parameter exploration diagnostic plotsCheckpointing and resuming, even with different number of live pointsWarm-start: resume from modified data / modelstrategic nested samplingcan vary (increase) number of live points (akin to dynamic nested sampling, but with different targets)can sample clusters optimally (e.g., at least 50 points per cluster/mode/solution)can target minimizing parameter estimation uncertaintiescan target a desired evidence uncertainty thresholdcan target a desired number of effective samplesor any combination of the aboveRobust ln(Z) uncertainties by bootstrapping live points.UsageGet started!Read the full documentation with tutorials at:https://johannesbuchner.github.io/UltraNest/API Reference:.Code repository: https://github.com/JohannesBuchner/UltraNest/LicenceHow tocite UltraNest.GPLv3 (see LICENCE file). If you require another license, please contact me.The cute hedgehog icon was made byFreepik.
It symbolises UltraNest’s approach of carefully walking up a likelihood,
ready to defend against any encountered danger.Release Notes4.1.0 (2023-02-15)add number of steps calibrator ultranest.calibrator.ReactiveNestedCalibratoradd relative jump distance diagnostic for step samplersmake population step samplers more consistent with other step samplers4.0.0 (2023-02-15)replace ultranest.mlfriends.AffineLayer with new ultranest.mlfriends.MaxPrincipleGapAffineLayerThis changes the learned covariance to be hopefully boost local features, make MLFriends identify smaller neighbourhoods, and thereby make sampling faster.3.6.5 (2023-07-18)documentation improvementslogging with MPI fixesby adipol-phandby gregorydavidmartinezmore flexible plottingby facero3.6.0 (2023-06-22)add PopulationRandomWalkSampler: vectorized Gaussian random walks for GPU/JAX-powered likelihoodslimit initial widening to escape plateau (issue #81)3.5.0 (2022-09-05)add hot-resume: resume from a similar fit (with different data)fix post_summary.csv column orderfix build handling for non-pip systems (pyproject.toml)more efficient handling of categorical variables3.4.0 (2022-04-05)add differential evolution proposal for slice sampling, recommend itfix revert of step sampler when run out of constraint, in MPIadd SimpleRegion: axis-aligned ellipsoidal for very high-d.3.3.3 (2021-09-17)pretty marginal posterior plot to stdoutavoid non-terminations when logzerr cannot be reachedadd RobustEllipsoidRegion: ellipsoidal without MLFriends for high-d.add WrappingEllipsoid: for additional rejection.bug fixes on rank order testadd resume-similarmodular step samplers3.0.0 (2020-10-03)Accelerated Hit-and-Run Sampler addedSupport for other languages (C, C++, Julia, Fortran) addedInsertion order test addedWarm-start addedRejection sampling with transformed ellipsoid added2.2.0 (2020-02-07)allow reading UltraNest outputs without ReactiveNestedSampler instance2.1.0 (2020-02-07)adaptive number of steps for slice and hit-and-run samplers.2.0.0 (2019-10-03)First release.1.0.0 (2014)A simpler version referenced in Buchner et al. (2014),
combining RadFriends with an optional Metropolis-Hastings proposal.