DNest4: Diffusive Nested Sampling in C++ and Python

Brendon J. Brewer, Daniel Foreman-Mackey
6/12/2016
stat.COastro-ph.IMphysics.data-an

Official code: eggplantbren/DNest4 (74 stars, MIT, last commit 2026-07-12).

Abstract

In probabilistic (Bayesian) inferences, we typically want to compute properties of the posterior distribution, describing knowledge of unknown quantities in the context of a particular dataset and the assumed prior information. The marginal likelihood, also known as the "evidence", is a key quantity in Bayesian model selection. The Diffusive Nested Sampling algorithm, a variant of Nested Sampling, is a powerful tool for generating posterior samples and estimating marginal likelihoods. It is effective at solving complex problems including many where the posterior distribution is multimodal or has strong dependencies between variables. DNest4 is an open source (MIT licensed), multi-threaded implementation of this algorithm in C++11, along with associated utilities including: i) RJObject, a class template for finite mixture models, (ii) A Python package allowing basic use without C++ coding, and iii) Experimental support for models implemented in Julia. In this paper we demonstrate DNest4 usage through examples including simple Bayesian data analysis, finite mixture models, and Approximate Bayesian Computation.

View on arXivView PDF

Code Implementations(1)

MIT

Diffusive Nested Sampling

7424C, RDec 9, 20153 months agoMIT
bayesian-inferencemarkov-chain-monte-carlonested-samplingprobabilistic-programmingprobability

Similar Papers

Cite this paper

@article{brewer2016dnest,
  title  = {DNest4: Diffusive Nested Sampling in C++ and Python},
  author = {Brendon J. Brewer and Daniel Foreman-Mackey},
  year   = {2016},
  eprint = {1606.03757},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1606.03757}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1606.03757.svg)](https://codeofpaper.com/paper/1606.03757)

Discussion