deanie

An embedded probabilistic programming language.
Log | Files | Refs | README | LICENSE

commit f7781a8d098ee72f02b634f9d19a077937ef5f6f
parent 06b5cb1cccbea56745af22865fe2bc011048a792
Author: Jared Tobin <jared@jtobin.ca>
Date:   Mon,  6 Mar 2017 10:44:50 +1300

Update README.

Diffstat:
MREADME.md | 30+++++++++++++++++++++++++++++-
Aassets/mixture_cdf.png | 0
2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md @@ -27,7 +27,8 @@ You can sample from them by first converting them into an *RVar* from > sample (rvar (mixture 1 3)) ``` -Sample more using standard monadic combinators like 'replicateM': +Sample many times from models using standard monadic combinators like +'replicateM': ``` > replicateM 1000 (sample (rvar (mixture 1 3))) @@ -35,6 +36,15 @@ Sample more using standard monadic combinators like 'replicateM': ![](assets/mixture.png) +Or convert them to measures using a built-in interpreter: + +``` +> let nu = measure (mixture 1 3) +> let f = cdf nu +``` + +![](assets/mixture_cdf.png) + You can perform inference on models using rejection or importance sampling, or use a simple, stateful Metropolis backend. Here's a simple beta-bernoulli model conditioned on the provided observations: @@ -80,5 +90,23 @@ weighted average for weighted samples returned via importance sampling: 0.6369246537796793 ``` +## Background + +You can read about some of the theory and ideas behind this kind of language in +some blog posts I've written. + +* [Encoding Statistical Independence, Statically][enco] +* [A Simple Embedded Probabilistic Programming Language][sppl] +* [Comonadic MCMC][como] +* [Foundations of the Giry Monad][gifo] +* [Implementing the Giry Monad][gimp] +* [The Applicative Structure of the Giry Monad][giap] + +[giap]: /giry-monad-applicative +[gimp]: /giry-monad-implementation +[gifo]: /giry-monad-foundations +[enco]: /encoding-independence-statically +[sppl]: /simple-probabilistic-programming +[como]: /comonadic-mcmc [rafu]: https://hackage.haskell.org/package/random-fu diff --git a/assets/mixture_cdf.png b/assets/mixture_cdf.png Binary files differ.