measurable

A simple shallowly-embedded DSL for dealing with measures.
git clone git://git.jtobin.io/measurable.git
Log | Files | Refs | README | LICENSE

README.md (1632B)


      1 
      2 # measurable
      3 
      4 [![BSD3 License](https://img.shields.io/badge/license-BSD3-blue.svg)](https://github.com/jtobin/measurable/blob/master/LICENSE)
      5 
      6 **measurable** is a simple shallowly-embedded DSL for dealing with measures.
      7 
      8 It uses a `Measure` synonym for a standard continuation type with a restricted
      9 output type and no `callCC` implementation.  You can construct measures from
     10 samples, mass/density functions, or even sampling functions.
     11 
     12 Construct image measures by `fmap`-ing measurable functions over them, or
     13 create new measures from existing ones by measure convolution and friends
     14 provided by a simple `Num` instance enabled by an `Applicative` instance.
     15 Create measures from graphs of other measures using the `Monad` instance and
     16 do-notation.
     17 
     18 Query measures by integrating measurable functions against them.  Extract
     19 moments, cumulative density functions, or probabilities.
     20 
     21 You can check out a few blog posts I wrote about the theoretical foundations
     22 and implementation of the library here:
     23 
     24 * [Foundations of the Giry Monad][foun]
     25 * [Implementing the Giry Monad][impl]
     26 * [The Applicative Structure of the Giry Monad][appl]
     27 
     28 A more polished and extended version of the above appears in chapter three of
     29 [my dissertation][diss].
     30 
     31 Caveat: while fun to play with, and rewarding to see how measures fit together,
     32 measure operations as nested integrals are exponentially complex.  Don't expect
     33 them to scale very far!
     34 
     35 [diss]: https://jtobin.io/assets/jtobin-dissertation.pdf
     36 [foun]: https://jtobin.io/giry-monad-foundations
     37 [impl]: https://jtobin.io/giry-monad-implementation
     38 [appl]: https://jtobin.io/giry-monad-applicative