Bayesian Modeling and Computation in Python aims to help beginner Bayesian practitioners to become intermediate modelers. It uses a hands on approach with PyMC3, Tensorflow Probability, ArviZ and other libraries focusing on the practice of applied statistics with references to the underlying mathematical theory. The book starts with a refresher of the Bayesian Inference concepts. The second chapter introduces modern methods for Exploratory Analysis of Bayesian Models. With an understanding of these two fundamentals the subsequent chapters talk through various models including linear regressions, splines, time series, Bayesian additive regression trees. The final chapters include Approximate Bayesian Computation, end to end case studies showing how to apply Bayesian modelling in different settings, and a chapter about the internals of probabilistic programming languages. Finally the last chapter serves as a reference for the rest of the book by getting closer into mathematical aspects or by extending the discussion of certain topics. This book is written by contributors of PyMC3, ArviZ, Bambi, and Tensorflow Probability among other libraries.
I consider the authors (and other PyMC3 core contributors) modern-day Bayesian superheros up there with the legends Kruschke, McElreath, Gelman, and others. I am deeply appreciative of all of the thoughtfulness and effort that went into making PyMC3 as it made a topic I would have considered forever inaccessible (as a non-math major) into something welcoming.
The choice of chapter topics is interesting, but my guess is this has to do with what the authors felt was adequately covered in other books and informed by their own areas of expertise. For example, not much time is spent explaining when certain likelihoods or distributions would be appropriate or hierarchical modeling. Despite often mentioning that "additional considerations could be modeled", these are not expanded upon (like in the section on missing data). While I agree with the authors about starting simple and avoiding needless complexity and loved the section on applied examples, it would have been nice to learn a bit more about how to build intuition when a case DOES demand complexity. The chapters on splines, BARTs, and ABC contained a lot of new information (to me) that I hadn't seen in other books, so that was really great to read about. Given the authors are heavily involved in the PPL space, I understand why they included TF examples and an entire chapter on PPLs, but I find the TF syntax — especially when compared side-by-side with PyMC3 — pretty awful to read or write. Providing an example where TF handles a use-case that PyMC3 doesn't would have been interesting.
There are a small number of trivial typos throughout the book, but I read a preprint and they do not distract from the overall quality of the text.
Thank you Osvaldo, Ravin, and Junpeng for your hard work in putting this book together. Your enthusiasm for the topic is contagious!
This book is an outstanding resource for anybody interested in Bayesian modeling in Python. It gives a great overview of Bayesian modeling and model quality metrics with plenty of examples in pymc3 and TensorFlow Probability PPL libraries. I found the examples particularly helpful. Each chapter has multiple homework problems which is a great feature of this book. Note that this is not a beginner book, you need to have some background in both Bayesian modeling and Python. If you are a complete newcomer to Bayesian statistics I recommend "Statistical Rethinking: A Bayesian Course with Examples in R and STAN" by Richard McElreath as a good first book. After you gain some familiarity with Bayesian approach this book is a great next step.