# 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. In addition, BAT.jl provides (as an experimental feature) a very lightweight binary RPC protocol that is easy to implement, to call non-Julia likelihood functions written in another language and running in separate processes.

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.3, we recommend to use Julia >= v1.6.

## 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},
}

If you use BAT.AHMIntegration as an important part of your work, please also cite Caldwell et al. "Integration with an Adaptive Harmonic Mean Algorithm", IJMPA (2020).

@article{Caldwell:2020AHMI,
author    = {Caldwell, Allen and Eller, Philipp and Hafych, Vasyl and Schick, Rafael and Schulz, Oliver and Szalay, Marco},
journal   = {International Journal of Modern Physics A},
title     = {Integration with an adaptive harmonic mean algorithm},
year      = {2020},
number    = {24},
pages     = {2050142},
volume    = {35},
doi       = {10.1142/S0217751X20501420},
publisher = {World Scientific},
}

If you use BAT.PartitionedSampling (experimental feature) as an important part of your work, please also cite Hafych et al. "Parallelizing MCMC Sampling via Space Partitioning", arXiv:2008.03098 (2020).

@article{Hafych:2008.03098,
author        = {Hafych, Vasyl and Eller, Philipp and Caldwell, Allen and Schulz, Oliver},
title         = {Parallelizing MCMC Sampling via Space Partitioning},
year          = {2018},
month         = {8},
archiveprefix = {arXiv},
eprint        = {2008.03098},
primaryclass  = {stat.CO},
}