Difference between revisions of "Probabilistic Functional Programming"

From HaskellWiki
Jump to navigation Jump to search
m (Probability moved to Probabilistic Functional Programming)
(→‎See also: Added reference to Practical Probabilistic Programming with Monads)
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
Probabilistic functional programming is a library for discrete random variables in terms of their distribution.
 
Probabilistic functional programming is a library for discrete random variables in terms of their distribution.
  +
A distribution represent the outcome of a probabilistic event as a collection of all possible values, tagged with their likelihood.
  +
It turns out that random variables establish a monad, namely a list monad where all items are equipped with a probability.
  +
A nice aspect of this system is that simulations can be specified independently from their method of execution.
  +
That is, we can either fully simulate or randomize any simulation without altering the code which defines it.
 
Examples include dice games, the Monty Hall paradoxon and others.
 
Examples include dice games, the Monty Hall paradoxon and others.
   
 
* Erwig and Kollmansberger: [http://web.engr.oregonstate.edu/~erwig/papers/PFP_JFP06.pdf Probabilistic Functional Programming]
 
* Erwig and Kollmansberger: [http://web.engr.oregonstate.edu/~erwig/papers/PFP_JFP06.pdf Probabilistic Functional Programming]
  +
* http://eecs.oregonstate.edu/~erwig/pfp/
  +
  +
Version maintained by Henning Thielemann:
  +
 
* http://hackage.haskell.org/cgi-bin/hackage-scripts/package/probability
 
* http://hackage.haskell.org/cgi-bin/hackage-scripts/package/probability
  +
* <code>darcs get http://code.haskell.org/~thielema/probability/</code>
  +
  +
== Future ==
  +
  +
Currently it is annoying that the distribution monad is not able to accumulate the probabilities of equal elements automatically.
  +
Thus you must make this manually, whenever you feel that it is necessary.
  +
This is due to a restriction of the monad class, that does not allow restrictions of the types of the monadic result.
  +
However using the [http://hackage.haskell.org/package/rmonad RMonad] we could implement the desired functionality.
   
 
== See also ==
 
== See also ==
Line 9: Line 25:
 
* [[New monads/MonadRandom]]
 
* [[New monads/MonadRandom]]
 
* http://hackage.haskell.org/cgi-bin/hackage-scripts/package/ProbabilityMonads
 
* http://hackage.haskell.org/cgi-bin/hackage-scripts/package/ProbabilityMonads
  +
* Mark Dominus gives [http://blog.plover.com/prog/haskell/probmonad-refs.html A short bibliography of probability monads]
  +
* Scibior, Ghahramani and Gordon: [http://mlg.eng.cam.ac.uk/pub/pdf/SciGhaGor15.pdf Practical Probabilistic Programming with Monads]
   
 
[[Category:Libraries]]
 
[[Category:Libraries]]

Latest revision as of 22:15, 27 November 2016

Probabilistic functional programming is a library for discrete random variables in terms of their distribution. A distribution represent the outcome of a probabilistic event as a collection of all possible values, tagged with their likelihood. It turns out that random variables establish a monad, namely a list monad where all items are equipped with a probability. A nice aspect of this system is that simulations can be specified independently from their method of execution. That is, we can either fully simulate or randomize any simulation without altering the code which defines it. Examples include dice games, the Monty Hall paradoxon and others.

Version maintained by Henning Thielemann:

Future

Currently it is annoying that the distribution monad is not able to accumulate the probabilities of equal elements automatically. Thus you must make this manually, whenever you feel that it is necessary. This is due to a restriction of the monad class, that does not allow restrictions of the types of the monadic result. However using the RMonad we could implement the desired functionality.

See also