BAT.jl Documentation

BAT.jl is a Bayesian Analysis Toolkit in Julia. It is a high-performance tool box for Bayesian inference with statistical models expressed in a general-purpose programming language instead of a domain-specific language.

Typical applications for this package are parameter inference given a model (in the form of a likelihood function and prior), the comparison of different models in the light of a given data set, and the test of the validity of a model to represent the data set at hand. BAT.jl provides access to the full Bayesian posterior distribution to enable parameter estimation, limit setting and uncertainty propagation. BAT.jl also provides supporting functionality like plotting recipes and reporting functions.

BAT.jl is implemented in pure Julia and allows for a flexible definition of mathematical models and applications while enabling the user to code for the performance required for computationally expensive numerical operations. BAT.jl provides implementations (internally and via other Julia packages) of algorithms for sampling, optimization and integration. BAT's main focus is on the analysis of complex custom models. It is designed to enable parallel code execution at various levels (running multiple MCMC chains in parallel is provided out-of-the-box).

It's possible to use BAT.jl with likelihood functions implemented in languages other than Julia: Julia allows for calling code in C and Fortran, C++, Python and several other languages directly.

BAT.jl originated as a rewrite/redesign of BAT, the Bayesian Analysis Toolkit in C++. BAT.jl now offer a different set of functionality and a wider variety of algorithms than it's C++ predecessor.

Note

BAT.jl requires Julia >= v1.6, we recommend to use Julia >= v1.9 for optimal performance.

Table of contents

Citing BAT.jl

When using BAT.jl for research, teaching or similar, please cite Schulz et al. "BAT.jl: A Julia-Based Tool for Bayesian Inference", SNCS (2021).

@article{Schulz:2021BAT,
  author  = {Schulz, Oliver and Beaujean, Frederik and Caldwell, Allen and Grunwald, Cornelius and Hafych, Vasyl and Kr{\"o}ninger, Kevin and Cagnina, Salvatore La and R{\"o}hrig, Lars and Shtembari, Lolian},
  journal = {SN Computer Science},
  title   = {BAT.jl: A Julia-Based Tool for Bayesian Inference},
  year    = {2021},
  issn    = {2661-8907},
  month   = {Apr},
  number  = {3},
  pages   = {210},
  volume  = {2},
  day     = {12},
  doi     = {10.1007/s42979-021-00626-4},
  url     = {https://doi.org/10.1007/s42979-021-00626-4},
}

Learning (more about) Julia

BAT.jl supersedes BAT in C++. If you're considering to switch to BAT.jl, but you're new to Julia and want to learn more about the the language, here are a few resources to get started:

The Julia website provides many links to introductory videos and written tutorials, e.g. "Intro to Julia", Think Julia: How to Think Like a Computer Scientist and "The Fast Track to Julia". If you are familiar with MATLAB or Python, you may also want to take a look at the "MATLAB–Python–Julia cheatsheet".

The in-depth article Why Numba and Cython are not substitutes for Julia explains how Julia addresses several fundamental challenges inherent to scientific high-performance computing.

Acknowledgements

We acknowledge the contributions from all the BAT.jl users, they help us make BAT.jl a better project. Your help is most welcome!

Development of BAT.jl has been supported by funding from