# Turing.jl: Bayesian inference with probabilistic programming

### Intuitive

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

### General-purpose

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

### Modular

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

Turing is fast.

## 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(\sigma^2, \mu \mid x, y)$:

\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(σ²))
end

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.

Samplers

## 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

## Community

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

### GitHub

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

### Discourse

Browse and join discussions on Turing.

### Slack

Discuss advanced topics. Request access here.

## Ecosystem

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

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

### MCMCChains

Chain types and utility functions for MCMC simulations.

Go to MCMCChains

### Bijectors

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.