The duck book "Bayesian Statistical Modeling with Stan and R" is a famous book in the Bayesian neighborhood. It's a good idea to pick it up first when you want to implement Bayesian inference. However, since it is not a book that explains what Bayes is, if you are not convinced about the advantages that can be obtained by updating the posterior distribution by accumulating cases within the framework of Bayes, Bayes itself I think it is better to challenge after reading the basic explanation of.
In the official of the above book, the implementation is R as the title says. I think many people want to implement it in Python. I was one of them, so I made a Python implementation.
As for the Stan interface, PyStan provides almost the same usability as R. On the other hand, since Pandas is used for data formatting, the code is quite different from R.
Please see the following for details.
requirements.txt https://github.com/MasazI/python-r-stan-bayesian-model-2/blob/master/exec/requirements.txt
All the code is on Github, so I think you can run it right away. All exercises are also solved in Python.
Github https://github.com/MasazI/python-r-stan-bayesian-model-2
If you have any questions, I would appreciate it if you could give me a pull request.
Recommended Posts