# Probabilistic Programming in Birch

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.

## Example

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

β:Real <- 0.9;
σ2:Real <- 1.0;
T:Integer <- 10;
x:Random<Real>[T];
y:Random<Real>[T];

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);
}


## Acknowledgements

The development of Birch is financially supported by the Swedish Foundation for Strategic Research (SSF) via the project ASSEMBLE.