Book Image

Bayesian Analysis with Python

Book Image

Bayesian Analysis with Python

Overview of this book

The purpose of this book is to teach the main concepts of Bayesian data analysis. We will learn how to effectively use PyMC3, a Python library for probabilistic programming, to perform Bayesian parameter estimation, to check models and validate them. This book begins presenting the key concepts of the Bayesian framework and the main advantages of this approach from a practical point of view. Moving on, we will explore the power and flexibility of generalized linear models and how to adapt them to a wide array of problems, including regression and classification. We will also look into mixture models and clustering data, and we will finish with advanced topics like non-parametrics models and Gaussian processes. With the help of Python and PyMC3 you will learn to implement, check and expand Bayesian models to solve data analysis problems.
Table of Contents (15 chapters)
Bayesian Analysis with Python
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Chapter 2. Programming Probabilistically – A PyMC3 Primer

Now that we have a basic understanding of Bayesian statistics we are going to learn how to build probabilistic models using computational tools; specifically we are going to learn about probabilistic programming. The main idea is that we are going to use code to describe our models and make inferences from them. It is not that we are too lazy to learn the mathematical way, nor are we elitist hardcore hackers—I-dream-in-code. One important reason behind this choice is that many models do not lead to a closed-form analytic posterior, that is, we can only compute those posteriors using numerical techniques. Another reason to learn probabilistic programing is that modern Bayesian statistics is done mainly by writing code, and since we already know Python, why would we do it in another way?! Probabilistic programming offers an effective way to build complex models and allows us to focus more on model design, evaluation, and interpretation...