English

GetDist: a Python package for analysing Monte Carlo samples

Instrumentation and Methods for Astrophysics 2025-08-11 v2 Cosmology and Nongalactic Astrophysics Data Analysis, Statistics and Probability

Abstract

Monte Carlo techniques, including MCMC and other methods, are widely used in Bayesian inference to generate sets of samples from a parameter space of interest. The Python GetDist package provides tools for analysing these samples and calculating marginalized one- and two-dimensional densities using Kernel Density Estimation (KDE). Many Monte Carlo methods produce correlated and/or weighted samples, for example produced by MCMC, nested, or importance sampling, and there can be hard boundary priors. GetDist's baseline method consists of applying a linear boundary kernel, and then using multiplicative bias correction. The smoothing bandwidth is selected automatically following Botev et al., based on a mixture of heuristics and optimization results using the expected scaling with an effective number of samples (defined here to account for both MCMC correlations and weights). Two-dimensional KDE uses an automatically-determined elliptical Gaussian kernel for correlated distributions. The package includes tools for producing a variety of publication-quality figures using a simple named-parameter interface, as well as a graphical user interface that can be used for interactive exploration. It can also calculate convergence diagnostics, produce tables of limits, and output in LaTeX, and is publicly available.

Keywords

Cite

@article{arxiv.1910.13970,
  title  = {GetDist: a Python package for analysing Monte Carlo samples},
  author = {Antony Lewis},
  journal= {arXiv preprint arXiv:1910.13970},
  year   = {2025}
}

Comments

GetDist available on pypi or see https://getdist.readthedocs.io. v2: updated with detailed description of credible interval estimation, example of non-rectangular prior boundaries (GetDist 1.7, also with updated GUI)

R2 v1 2026-06-23T11:59:45.038Z