skip to main content
article
Open Access

Deriving a probability density calculator (functional pearl)

Published:04 September 2016Publication History
Skip Abstract Section

Abstract

Given an expression that denotes a probability distribution, often we want a corresponding density function, to use in probabilistic inference. Fortunately, the task of finding a density has been automated. It turns out that we can derive a compositional procedure for finding a density, by equational reasoning about integrals, starting with the mathematical specification of what a density is. Moreover, the density found can be run as an estimation algorithm, as well as simplified as an exact formula to improve the estimate.

References

  1. S. Bhat, A. Agarwal, R. Vuduc, and A. Gray. A type theory for probability density functions. In Proceedings of POPL 2012, pages 545–556. ACM Press, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. S. Bhat, J. Borgström, A. D. Gordon, and C. V. Russo. Deriving probability density functions from probabilistic functional programs. In N. Piterman and S. A. Smolka, editors, Proceedings of TACAS 2013, number 7795 in Lecture Notes in Computer Science, pages 508–522. Springer, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. R. S. Bird. Tabulation techniques for recursive programs. ACM Computing Surveys, 12(4):403–417, 1980. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. K. Claessen and J. Hughes. QuickCheck: A lightweight tool for random testing of Haskell programs. In Proceedings of ICFP 2000, pages 268– 279. ACM Press, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. M. J. Fischer. Lambda-calculus schemata. Lisp and Symbolic Computation, 6(3–4):259–288, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. D. Freedman, R. Pisani, and R. Purves. Statistics. W. W. Norton, fourth edition, 2007.Google ScholarGoogle Scholar
  7. J. Gibbons and N. Wu. Folding domain-specific languages: Deep and shallow embeddings (functional pearl). In J. Jeuring and M. M. T. Chakravarty, editors, Proceedings of ICFP 2014, pages 339–347. ACM Press, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. R. Hinze. Deriving backtracking monad transformers. In Proceedings of ICFP 2000, pages 186–197. ACM Press, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. J. Hughes. The design of a pretty-printing library. In J. Jeuring and E. Meijer, editors, Advanced Functional Programming: 1st International Spring School on Advanced Functional Programming Techniques, number 925 in Lecture Notes in Computer Science, pages 53–96. Springer, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. P. J. Landin. The mechanical evaluation of expressions. The Computer Journal, 6(4):308–320, 1964.Google ScholarGoogle ScholarCross RefCross Ref
  11. J. Launchbury. A natural semantics for lazy evaluation. In Proceedings of POPL 1993, pages 144–154. ACM Press, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. D. J. C. MacKay. Introduction to Monte Carlo methods. In M. I. Jordan, editor, Learning and Inference in Graphical Models. Kluwer, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Paperback: Learning in Graphical Models, MIT Press.Google ScholarGoogle Scholar
  14. J. Pearl. Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference. Morgan Kaufmann, 1988. Revised 2nd printing, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. A. Pettorossi. A powerful strategy for deriving efficient programs by transformation. In Proceedings of the 1984 ACM Symposium on Lisp and Functional Programming, pages 273–281. ACM Press, 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. S. Peyton Jones, editor. Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press, 2003.Google ScholarGoogle Scholar
  17. A. Pfeffer. CTPPL: A continuous time probabilistic programming language. In C. Boutilier, editor, Proceedings of the 21st International Joint Conference on Artificial Intelligence, pages 1943–1950, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. D. Pollard. A User’s Guide to Measure Theoretic Probability. Cambridge University Press, 2001.Google ScholarGoogle Scholar
  19. J. C. Reynolds. Definitional interpreters for higher-order programming languages. In Proceedings of the ACM National Conference, volume 2, pages 717–740. ACM Press, 1972. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. C. Strachey and C. P. Wadsworth. Continuations: A mathematical semantics for handling full jumps. Technical Monograph PRG-11, Programming Research Group, Oxford University Computing Laboratory, 1974.Google ScholarGoogle Scholar
  21. L. Tierney. A note on Metropolis-Hastings kernels for general state spaces. The Annals of Applied Probability, 8(1):1–9, 1998.Google ScholarGoogle ScholarCross RefCross Ref
  22. P. L. Wadler. How to replace failure by a list of successes: A method for exception handling, backtracking, and pattern matching in lazy functional languages. In J.-P. Jouannaud, editor, Functional Programming Languages and Computer Architecture, number 201 in Lecture Notes in Computer Science, pages 113–128. Springer, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Deriving a probability density calculator (functional pearl)

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!