Copyright | Copyright (c) 2016 the Hakaru team |
---|---|

License | BSD3 |

Maintainer | wren@community.haskell.org |

Stability | experimental |

Portability | GHC-only |

Safe Haskell | None |

Language | Haskell2010 |

# Documentation

normalize :: ABT Term abt => abt '[] (HMeasure a) -> abt '[] (HMeasure a) Source #

Convert an arbitrary measure into a probability measure; i.e., reweight things so that the total weight/mass is 1.

total :: ABT Term abt => abt '[] (HMeasure a) -> abt '[] HProb Source #

Compute the total weight/mass of a measure.

expect :: ABT Term abt => abt '[] (HMeasure a) -> abt '[a] HProb -> abt '[] HProb Source #

Convert a measure into its integrator. N.B., the second argument
is (a representation of) a measurable function from `a`

to
'HProb`. We represent it as a binding form rather than as `

abt
'[] (a ':-> 'HProb)```
in order to avoid introducing administrative
redexes. We could, instead, have used a Haskell function
```

abt
'[] a -> abt '[] 'HProb@ to eliminate the administrative redexes,
but that would introduce other implementation difficulties we'd
rather avoid.