camdl

Compartmental Model Description Language

Author

Vince Buffalo

Published

January 1, 2026

What is camdl?

camdl (the Compartmental Model Description Language) is a domain-specific language for stochastic epidemic models. You write the scientific model — compartments, transitions, observation process — in a .camdl file that reads like the equations on a whiteboard. A compiler checks the model’s semantics, and a Rust backend handles simulation and inference.

compartments { S, I, R }

parameters {
  beta  : rate
  gamma : rate
}

transitions {
  infection : S --> I @ beta * S * I / (S + I + R)
  recovery  : I --> R @ gamma * I
}

The separation is the point: the math is the model, the implementation is someone else’s problem. camdl’s compiler catches whole classes of bugs (dimension mismatches, undefined compartments, inconsistent population accounting) before a single trajectory is simulated.

The toolchain covers the full modeling workflow — forward simulation, parameter sweeps, scenario comparison, maximum likelihood estimation via iterated filtering (IF2), Bayesian posterior sampling (PGAS+NUTS), profile likelihoods, simulation-based calibration, and model comparison via prequential scoring. Start with the Getting Started guide.