[Haskell-cafe] Lazy Probabilistic Programming System in Haskell

Benjamin Redelings benjamin.redelings at gmail.com
Fri Jul 16 00:36:08 UTC 2021


My program BAli-Phy implements probabilistic programming with models 
written as Haskell programs.


Unlike [1], models are *lazy* in the sense that you can generate an 
infinite list of random variables, as long as you only access a finite 
number.  I am also using MCMC for inference, not particle filters.

BAli-Phy implements a Haskell interpreter in C++ that records execution 
traces of Haskell programs.  When a random variable is modified (during 
MCMC), the parts of the execution trace that depend on the changed 
variables are invalidated and recomputed. This saves work by not 
recomputing the probability of the new state from scratch.

Here's a example of a model written in Haskell:


WARNING: There are lots sharp edges.  First and foremost, no type 
system! (yet)


[1] Practical probabilistic programming with monads, 

More information about the Haskell-Cafe mailing list