Skip to content

Languages

Here we provide an overview of the most popular probabilistic modelling frameworks.

Programming is like playing an instrument; everyone has their own favorite, so choose what best suits you! 🌈

R

If you are familiar with R’s formula syntax for modelling, brms will allow you to transfer all of this knowledge to Bayesian methods. R does not have its own, embedded probabilistic programming language and instead uses Stan as a backend for computation.

Once you have fit a model, the Bayesian workflow heavily relies on visualizations to understand the model and diagnose potential issues. Many of the most common techniques for this are implemented in the bayesplot package.

If you would like to write a model in Stan, you can fit it in R using R’s interface to Stan, RStan. It allows you to fit models written in Stan and continue analyzing the results in R.

Python Work In Progress

A dedicated package for Bayesian inference in Python is PyMC.

Julia

Julia is a language designed for scientific computation. Julia is fast, so it is possible to do Bayesian inference purely in Julia.

Julia’s modularity has given rise to several probabilistic programming frameworks, with the most popular being Turing.jl. Its syntax stays close to the mathematical formulation of your model. For those who enjoy learning by doing, this close correspondence between code and math can be a great opportunity for learning.

With the exception of a few special operators, a Turing model is just normal Julia code. Basic diagnostic functions are implemented, but you should not expect the same suite of convenience functions as in R.

Julia also has an interface to Stan, Stan.jl, though it is less mature than the equivalent in R, RStan.

Stan

All of the above langauges have interfaces to Stan. This makes is possible to write models as .stan files, fit them from R, Python or Julia, and continue working with the result in the language of your choice.