Overview

It is tedious and many times impossible to do inference by hand. Fortunately, many steps can be automated and calculated with a computer, as in many other subjects. In the realm of probability, this is called probabilistic programming. We can use the computer, in any suitable language, to help us i) build Bayesian models, ii) draw samples from them, iii) do inference with them, and so on.

For teaching purposes, it is important to make the code as explicit and clear as possible. But on the field, in actual applications, a more general and extensible framework is useful. For that, there exist a number of packages for probabilistic programming in several languages. In Julia, you can easily access classical tools and packages such as STAN, via Stan.jl, and pyMC, via JuliaPy/PyCall.jl or cjdoris/PythonCall.jl.

But if you want to leverage all the power of Julia, a proper julia-native probabilistic programming package is the best choice, such as Turing.jl, Soss.jl, Gen.jl, and others. See the thread Current state of Julia Probabilistic Programming Languages and functionalities on Discourse for a discussion of the available packages.

Here, we will mainly either compute things explicit, for didactical purposes, or use Turing.jl, with real applications in mind. It is easy to combine Turing.jl with other packages, such as those from SciML, to do Bayesing inference on models involving all sorts of differential equations.