Doing Bayesian Data Analysis in Julia using Turing.jl
What and why
Kruschke began his text with, “This book explains how to actually do Bayesian data analysis, by real people (like you), for realistic data (like yours).” In the same way, this project is designed to help those real people do Bayesian data analysis. My contribution is converting Kruschke’s JAGS and Stan code for use in another probabilistic programming framework,Turing.jl
, which makes it easier to fit Bayesian regression models in Julia (Ge, Xu, and Ghahramani (2018)) using a number of samplers. I also prefer plotting and data wrangling with the packages from Plots.jl
(Bezanson et al. (2017)). So we’ll be using those methods, too.
This ebook is not meant to stand alone. It’s a supplement to the second edition of Kruschke (2015) Doing Bayesian data analysis: A tutorial with R, JAGS, and Stan. Please give the source material some love.
Julia setup
To follow along with this guide, you’ll need some software. Download and install Julia by following the instructions at https://julialang.org/downloads/. The Getting Started page has in depth instructions that can help.
You will also need to install some packages. To install packages in Julia, you will need the Pkg
package. Fortunately the Julia REPL (which stands for “read, execute, print, loop”) has a trick that allows you to access the package from within the REPL command-line. Enter the Pkg REPL by pressing ] from the Julia REPL. To get back to the Julia REPL, press backspace.
For more information on the Pkg REPL, take a look at the Julia documentation, which is available here: https://docs.julialang.org/en/v1/stdlib/Pkg/.
Version 0.0.1.
I am just starting this project. I plan to have a complete draft including material from all the chapters in Kruschke’s text by January 2023