# Probabilistic Programming in OCaml

*2018-01-01 — idea*


Status: Completed
Level: PartII
Year: 2018
Project: OCaml Labs
Supervisors: Tom Kelly, Liang Wang, Anil Madhavapeddy
Students: Hari Chandrasekaran


With increasing use of machine learning, it is useful to develop frameworks
that support rapid development and functional specification of probabilistic
models for inference and reasoning.  Probabilistic Programming Languages aim to
support concise syntax for specifying models and consequently making inference
easier. This can pave way to improvements of the model created, more data
gathering and further model refinement in an iterative sense.

PPL enables easier development of statistical models and allows decoupling
inference from modelling.  There is a lot of recent work on PPLs, and this
project seeks to incorporate them into functional languages.  This project aims
to develop a small PPL with a graph based model for Bayesian inference (similar
to the Edward PPL) into the Owl numerical library written in OCaml.


The implementation focusses on modularity, enabling the composability of models
and allowing them contain parameters which could be random variables from
common probability distributions or deterministic functions or combinations of
other random variables.  The language would allow the specification of
generative models that model the joint probability distribution of latent
variables and observed parameters, and inference by conditioning.  The initial
focus will be on common statistical inference methods such as MCMC.  Other
inference algorithms such as Hamiltonian Monte Carlo or Variational Inference
will be explored as optional extensions to the project.

# Background reading

- ["Functional Programming for modular Bayesian Inference"](https://dl.acm.org/doi/10.1145/3236778)
- Dustin Tran, Alp Kucukelbir, Adji B. Dieng, Maja Rudolph, Dawen Liang, and David M. Blei. [Edward: A library for probabilistic modeling, inference, and criticism](https://arxiv.org/abs/1610.09787), 2016
- Liang Wang. 2017. Owl: A General-Purpose Numerical Library in OCaml.

## Links

The dissertation is not available online; contact Hari Chandrasekaran directly to obtain a
copy.

---
Canonical: https://anil.recoil.org/ideas/prob-programming-owl
Type: idea
License: CC BY 4.0 <https://creativecommons.org/licenses/by/4.0/>
Tags: ai, ocaml, fp, probablistic
