Second editionThe second edition is available here amazon.com/dp/B07HHBCR9GKey FeaturesSimplify the Bayes process for solving complex statistical problems using Python;Tutorial guide that will take the you through the journey of Bayesian analysis with the help of sample problems and practice exercises;Learn how and when to use Bayesian analysis in your applications with this guide.Book DescriptionThe 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.What you will learnUnderstand the essentials Bayesian concepts from a practical point of viewLearn how to build probabilistic models using the Python library PyMC3Acquire the skills to sanity-check your models and modify them if necessaryAdd structure to your models and get the advantages of hierarchical modelsFind out how different models can be used to answer different data analysis questionsWhen in doubt, learn to choose between alternative models.Predict continuous target outcomes using regression analysis or assign classes using logistic and softmax regression.Learn how to think probabilistically and unleash the power and flexibility of the Bayesian frameworkAbout the AuthorOsvaldo Martin is a researcher at The National Scientific and Technical Research Council (CONICET), the main organization in charge of the promotion of science and technology in Argentina. He has worked on structural bioinformatics and computational biology problems, especially on how to validate structural protein models. He has experience in using Markov Chain Monte Carlo methods to simulate molecules and loves to use Python to solve data analysis problems. He has taught courses about structural bioinformatics, Python programming, and, more recently, Bayesian data analysis. Python and Bayesian statistics have transformed the way he looks at science and thinks about problems in general. Osvaldo was really motivated to write this book to help others in developing probabilistic models with Python, regardless of their mathematical background. He is an active member of the PyMOL community (a C/Python-based molecular viewer), and recently he has been making small contributions to the probabilistic programming library PyMC3.Table of ContentsThinking Probabilistically - A Bayesian Inference PrimerProgramming Probabilistically - A PyMC3 PrimerJuggling with Multi-Parametric and Hierarchical ModelsUnderstanding and Predicting Data with Linear Regression ModelsClassifying Outcomes with Logistic RegressionModel ComparisonMixture ModelsGaussian Processes
This is a pretty good hands-on book on using the PyMC3 library in Python to do Bayesian analysis. It also includes some introductory stuff on Bayesian statistics. I would recommend reading it if you want to learn more about Bayesian analysis.
My main takeaway is that PyMC3 (and apparently its intellectual ancestor STAN) are amazing. I had no idea that building Bayesian models was this easy to do. It allows a level of clarity and match of code to modeling concepts that is almost unmatched. The author is also one of the core developers of PyMC3, and this is clearly quite an achievement.
I like how hands-on a lot of the examples are, but the book is sort of weak on theory. Some of the notations used in the equations are poorly explained (or not explained at all), and required visiting Wikipedia to get them. However, after reading the book, I do feel like I have a good grasp of some basics that I had really not gotten in previous attempts to understand Bayesian statistics. In particular, the concept of a conjugate prior now makes a lot of sense, as does the pragmatic process for selecting and updating priors. (The book obviously doesn't solve the problem of choosing priors, but does give helpful starting places, rules of thumb and lots of examples.)
My other criticism is that the book needs more rounds with a good editor. The prose is often clunky: many sentences could be both shorter and clearer. It also has a lot of typos, some of which are pretty confusing. I'd suggest getting the hard copy, and marking it up with the errata by hand (see the errata here).
The conceptual organization should be reworked as well. I found myself repeatedly saying "Wow, how does PyMC3 do any of this?" and "what does this warning output mean?" when running through the examples, but then the underpinnings of how it works are described in Chapter 8. I think the "Inference Engines" chapter should have been much earlier in the book, since it would've let me build more intuition about how inference works or when it might fail.
I'd suggest reading it in the following order: 1. Chapter 1-2 to see introductory examples of how Bayesian modeling works with PyMC3. 2. Chapter 8 prior to the "Diagnosing the samples" section, and also this blog post. 3. Chapter 2 again. 4. Chapters 3-4. 5. The remainder of chapter 8. 6. Chapters 5-7. 7. Possibly chapter 8 again.
I also found it very helpful to read it with a Jupyter notebook open, typing in the code examples (all of which actually work! 😵), along with jotting down notes in Markdown cells. My notebook for this book will probably be handy as a reference for years to come.