PeerJ Computer Science (Apr 2016)

Probabilistic programming in Python using PyMC3

  • John Salvatier,
  • Thomas V. Wiecki,
  • Christopher Fonnesbeck

DOI
https://doi.org/10.7717/peerj-cs.55
Journal volume & issue
Vol. 2
p. e55

Abstract

Read online Read online

Probabilistic programming allows for automatic Bayesian inference on user-defined probabilistic models. Recent advances in Markov chain Monte Carlo (MCMC) sampling allow inference on increasingly complex models. This class of MCMC, known as Hamiltonian Monte Carlo, requires gradient information which is often not readily available. PyMC3 is a new open source probabilistic programming framework written in Python that uses Theano to compute gradients via automatic differentiation as well as compile probabilistic programs on-the-fly to C for increased speed. Contrary to other probabilistic programming languages, PyMC3 allows model specification directly in Python code. The lack of a domain specific language allows for great flexibility and direct interaction with the model. This paper is a tutorial-style introduction to this software package.

Keywords