Skip to content

Probabilistic Programming in Birch

Birch forest

Birch is an imperative, object-oriented, universal probabilistic programming language. It compiles to C++14 for Linux, macOS, and Windows 10, and is free and open source.

Probabilistic models are specified in Birch by writing a program to simulate the joint distribution. Inference methods are also written in Birch. Sequential Monte Carlo (SMC) is currently supported, with analytical optimizations—such as locally-optimal proposals and Rao–Blackwellization—applied automatically.

See Getting Started to try it yourself.


A simple linear-Gaussian state-space model written in Birch.

β:Real <- 0.9;
σ2:Real <- 1.0;
T:Integer <- 10;

x[1] ~ Gaussian(0.0, σ2);
y[1] ~ Gaussian(x[1], σ2);  
for (t:Integer in 2..T) {
  x[t] ~ Gaussian(β*x[t - 1], σ2);
  y[t] ~ Gaussian(x[t], σ2);