All Projects → TuringLang → NestedSamplers.jl

TuringLang / NestedSamplers.jl

Licence: MIT license
Implementations of single and multi-ellipsoid nested sampling

Programming Languages

julia
2034 projects

Projects that are alternatives of or similar to NestedSamplers.jl

nestle
Pure Python, MIT-licensed implementation of nested sampling algorithms for evaluating Bayesian evidence.
Stars: ✭ 66 (+106.25%)
Mutual labels:  bayesian-inference, nested-sampling
nessai
nessai: Nested Sampling with Artificial Intelligence
Stars: ✭ 18 (-43.75%)
Mutual labels:  bayesian-inference, nested-sampling
anesthetic
Nested Sampling post-processing and plotting
Stars: ✭ 34 (+6.25%)
Mutual labels:  bayesian-inference, nested-sampling
cpnest
Parallel nested sampling
Stars: ✭ 21 (-34.37%)
Mutual labels:  bayesian-inference, nested-sampling
PyLDA
A Latent Dirichlet Allocation implementation in Python.
Stars: ✭ 51 (+59.38%)
Mutual labels:  bayesian-inference
Bayesian Workshop
Material for a Bayesian statistics workshop
Stars: ✭ 34 (+6.25%)
Mutual labels:  bayesian-inference
Landmark Detection Robot Tracking SLAM-
Simultaneous Localization and Mapping(SLAM) also gives you a way to track the location of a robot in the world in real-time and identify the locations of landmarks such as buildings, trees, rocks, and other world features.
Stars: ✭ 14 (-56.25%)
Mutual labels:  bayesian-inference
webmc3
A web interface for exploring PyMC3 traces
Stars: ✭ 46 (+43.75%)
Mutual labels:  bayesian-inference
stan-ja
Stanマニュアルの日本語への翻訳プロジェクト
Stars: ✭ 53 (+65.63%)
Mutual labels:  bayesian-inference
ReactiveMP.jl
Julia package for automatic Bayesian inference on a factor graph with reactive message passing
Stars: ✭ 58 (+81.25%)
Mutual labels:  bayesian-inference
torsionfit
Bayesian tools for fitting molecular mechanics torsion parameters to quantum chemical data.
Stars: ✭ 15 (-53.12%)
Mutual labels:  bayesian-inference
KissABC.jl
Pure julia implementation of Multiple Affine Invariant Sampling for efficient Approximate Bayesian Computation
Stars: ✭ 28 (-12.5%)
Mutual labels:  bayesian-inference
TrendinessOfTrends
The Trendiness of Trends
Stars: ✭ 14 (-56.25%)
Mutual labels:  bayesian-inference
gammy
🐙 Generalized additive models in Python with a Bayesian twist
Stars: ✭ 65 (+103.13%)
Mutual labels:  bayesian-inference
DynamicHMCExamples.jl
Examples for Bayesian inference using DynamicHMC.jl and related packages.
Stars: ✭ 33 (+3.13%)
Mutual labels:  bayesian-inference
Bridge.jl
A statistical toolbox for diffusion processes and stochastic differential equations. Named after the Brownian Bridge.
Stars: ✭ 99 (+209.38%)
Mutual labels:  bayesian-inference
LDA thesis
Hierarchical, multi-label topic modelling with LDA
Stars: ✭ 49 (+53.13%)
Mutual labels:  bayesian-inference
MultiBUGS
Multi-core BUGS for fast Bayesian inference of large hierarchical models
Stars: ✭ 28 (-12.5%)
Mutual labels:  bayesian-inference
kernel-ep
UAI 2015. Kernel-based just-in-time learning for expectation propagation
Stars: ✭ 16 (-50%)
Mutual labels:  bayesian-inference
PyBGMM
Bayesian inference for Gaussian mixture model with some novel algorithms
Stars: ✭ 51 (+59.38%)
Mutual labels:  bayesian-inference

NestedSamplers.jl

Build Status PkgEval Coverage LICENSE

Stable Dev

Implementations of single- and multi-ellipsoidal nested sampling algorithms in pure Julia. We implement the AbstractMCMC.jl interface, allowing straightforward sampling from a variety of statistical models.

This package was heavily influenced by nestle, dynesty, and NestedSampling.jl.

Citing

DOI

If you use this library, or a derivative of it, in your work, please consider citing it. This code is built off a multitude of academic works, which have been noted in the docstrings where appropriate. These references, along with references for the more general calculations, can all be found in CITATION.bib

Installation

To use the nested samplers first install this library

julia> ]add NestedSamplers

Usage

For in-depth usage, see the online documentation. In general, you'll need to write a log-likelihood function and a prior transform function. These are supplied to a NestedModel, defining the statistical model

using NestedSamplers
using Distributions
using LinearAlgebra

logl(X) = logpdf(MvNormal([1, -1], I), X)
prior(X) = 4 .* (X .- 0.5)
# or equivalently
priors = [Uniform(-2, 2), Uniform(-2, 2)]
model = NestedModel(logl, priors)

after defining the model, set up the nested sampler. This will involve choosing the bounding space and proposal scheme, or you can rely on the defaults. In addition, we need to define the dimensionality of the problem and the number of live points. More points results in a more precise evidence estimate at the cost of runtime. For more information, see the docs.

bounds = Bounds.MultiEllipsoid
prop = Proposals.Slice(slices=10)
# 1000 live points
sampler = Nested(2, 1000; bounds=bounds, proposal=prop)

once the sampler is set up, we can leverage all of the AbstractMCMC.jl interface, including the step iterator, transducer, and a convenience sample method. The sample method takes keyword arguments for the convergence criteria.

Note: both the samples and the sampler state will be returned by sample

using StatsBase
chain, state = sample(model, sampler; dlogz=0.2)

you can resample taking into account the statistical weights, again using StatsBase

chain_resampled = sample(chain, Weights(vec(chain["weights"])), length(chain))

These are chains from MCMCChains.jl, which offer a lot of flexibility in exploring posteriors, combining data, and offering lots of convenient conversions (like to DataFrames).

Finally, we can see the estimate of the Bayesian evidence

using Measurements
state.logz ± state.logzerr

Contributions and Support

ColPrac: Contributor's Guide on Collaborative Practices for Community Packages

Primary Author: Miles Lucas (@mileslucas)

Contributions are always welcome! In general, contributions should follow ColPrac. Take a look at the issues for ideas of open problems! To discuss ideas or plan contributions, open a discussion.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].