Monday, September 29, 2014

Doing Bayesian Data Analysis in Python

Do you prefer Python? Some readers have undertaken to translate the computer programs from Doing Bayesian Data Analysis into Python, including Osvaldo Martin, who has this GitHub site for his ongoing project. If you are interested in what he has done, or if you are interested in contributing, please contact him. If you have your own Python-translation project going, please add a comment to this post. Thank you all for your contributions to make Bayesian methods available in all flavors.


  1. Python is a great choice, but I prefer PySTAN to PyMC. With PyMC I always had trouble creating models that run as fast as the compiled c code used by stan/jags.

    Anyway, we can now see who has nicer figures. The R in your book or python's matplotlib? :)

  2. Thanks for the link to the Github...I'm a fan of python and there looks to be some good stuff in Osvaldo's work there.

  3. John thanks for the post, and also for writing the book!!!
    Matus, did you try PyMC3? I think is faster than PyMC2. Here is a nice comparison of three python libraries for Bayesian data analysis

  4. I think some things should not be done in python, like when performance is important I prefer c libraries (ideally with python bindings).

  5. I recently started exploring Bayesian data analysis with help your excellent book and PyMC3 (Python).

    I am trying to implement the hierarchical models from chapter 9. With the 'Therapeutic Touch' data set I get comparable results. With the 'Batting Average' data set, not so much. Probably something with the model definition that I am doing wrong. Have to take a closer look at that...