StatisticalRethinkingJulia/StatisticalRethinking.jl
Julia package with selected functions in the R package `rethinking`. Used in the SR2... projects.
What it solves
StatisticalRethinking.jl brings the functionality of the R 'rethinking' package to Julia, making it easier to follow the examples and exercises in Richard McElreath's book "Statistical Rethinking". It streamlines the typical steps of Bayesian data analysis—from preparing data, defining MCMC models, and inspecting results—so you can focus on the concepts rather than boilerplate code.
How it works
The package provides a set of functions that can be used alongside different MCMC backends such as Turing.jl or StanSample.jl. You define your model using your preferred backend, obtain draws, and then use the package's utilities to process and inspect the chains. It also includes additional tools for causal modeling (StructuralCausalModels.jl) and model comparison (ParetoSmoothedImportanceSampling.jl) for WAIC and PSIS statistics. The package is designed to work in Jupyter or Pluto notebooks, with the latest version decoupling plotting to allow flexible graphics options.
Who it's for
This is for students and practitioners working through the "Statistical Rethinking" book who prefer Julia over R, or who want a portable, extensible set of tools for Bayesian analysis. It is also useful for instructors or self-learners who want to run the book's examples interactively.
Highlights
- Provides a Julia counterpart to the R 'rethinking' package.
- Supports both Turing.jl and Stan-based MCMC backends.
- Includes utilities for data preparation, model simulation, and chain conversion to DataFrames.
- Integrates model comparison with WAIC and PSIS statistics.
- Designed for Jupyter and Pluto notebooks, with a version-4 refactor for better package independence.
Related
- Project
- Project
- Project
- Project