The Turing Language GitHub Repo stars Twitter Follow

Turing.jl: Bayesian inference with probabilistic programming


Turing models are easy to read and write–models work the way you write them.


Specify complex models with discrete parameters and stochastic control flow easily.


Turing is modular, written fully in Julia and can be modified to suit your needs.

Hello World in Turing: Linear Gaussian Model

Turing's modelling syntax allows you to specify a model easily. Simple models can be expressed in the same way as complex, hierarchical models with stochastic control flow.

Get Started

In math

p(σ2,μx,y)p(\sigma^2, \mu \mid x, y):

σ2InverseGamma(2,3)μNormal(0,σ2)xNormal(0,σ2)yNormal(0,σ2)\begin{aligned} &\sigma^2 & &\sim & &\mathcal{I}\text{nverse}\mathcal{G}\text{amma}(2, 3) \\ &\mu & &\sim & &\mathcal{N}\text{ormal}(0, \sigma^2) \\ &x & &\sim & &\mathcal{N}\text{ormal}(0, \sigma^2) \\ &y & &\sim & &\mathcal{N}\text{ormal}(0, \sigma^2) \\ \end{aligned}

As Turing program

@model function lingauss(x, y)
  # Assumptions
  σ² ~ InverseGamma(2, 3)
  μ  ~ Normal(0, sqrt(σ²))
  # Observations
  x  ~ Normal(μ, sqrt(σ²))
  y  ~ Normal(μ, sqrt(σ²))


All news

Advanced Markov chain Monte Carlo samplers

Turing provides Hamiltonian Monte Carlo sampling for differentiable posterior distributions, Particle MCMC sampling for complex posterior distributions involving discrete variables and stochastic control flow, and Gibbs sampling which combines particle MCMC, HMC and many other MCMC algorithms.


Interoperation with deep learning libraries

Turing supports Julia's Flux package for automatic differentiation. Combine Turing and Flux to construct probabilistic variants of traditional machine learning models.

Bayesian Neural Network Tutrial


Join the Turing community to contribute, learn and get your questions answered.


Report bugs, request features, discuss statistical applications/theory, and more.


Browse and join discussions on Turing.


Discuss advanced topics. Request access here.


Explore a rich ecosystem of libraries, tools, and more to support development.


Robust, modular and efficient implementation of advanced Hamiltonian Monte Carlo algorithms.

Go to AdvancedHMC


Chain types and utility functions for MCMC simulations.

Go to MCMCChains


Automatic transformations for constrained random variables.

Go to Bijectors

CC BY-SA 4.0 The TuringLang Team. Last modified: June 25, 2022. Website built with Franklin.jl.