Bayesian Analysis with Python, 2nd Edition cover

Bayesian Analysis with Python, 2nd Edition

No rating yet
Word count
304K words
Chapters
9
ISBN
9787115600899

Tags

Summary

Bayesian Analysis with Python, 2nd Edition is an introductory book on Bayesian statistics and probabilistic programming from a hands-on programming perspective; the original title is Bayesian Analysis with Python, with the subtitle "Statistical Modeling and Probabilistic Programming with PyMC3 and ArviZ." The book does not rely on elaborate mathematical derivations; instead, using the probabilistic programming library PyMC3 and the Bayesian model exploration and analysis library ArviZ as tools, it guides readers step by step from Bayesian inference to code. The content proceeds in three stages—foundations, modeling, and extensions: Chapter 1 starts from the relationship between statistics and modeling, explaining the meaning of probability, single-parameter inference, how to report posterior results, and posterior predictive checks; Chapter 2 moves into probabilistic programming proper, introducing the PyMC3 modeling workflow, posterior summaries, Gaussian distributions and robust inference, comparisons between groups, and hierarchical models and shrinkage; Chapters 3–4 cover linear regression, robust regression, hierarchical regression, polynomial regression, multiple regression, and generalized linear models such as logistic regression, softmax regression, Poisson regression, and zero-inflated Poisson models; Chapters 5–7 discuss model comparison (information criteria, WAIC, Bayes factors, regularizing priors), finite and continuous mixture models, and Gaussian process regression, classification, and Cox processes; Chapter 8 explains inference engines, including non-Markovian and Markovian methods and sample diagnostics; Chapter 9 points toward further study. Compared with the first edition, the second edition has been extensively rewritten and reorganized; most figures are generated directly from the book's code, and full-color printing is used to better present code and visualizations. Each chapter ends with exercises, and the accompanying code can be downloaded from the Asynchronous Community (epubit.com) site, making the book suitable for systematic study by readers who want to use probabilistic thinking to solve real data analysis problems.

Editor's review

如果你被“贝叶斯”三个字中的公式吓退过,这本书会是个不错的例外。作者奥斯瓦尔多·马丁既是阿根廷国家科学与技术研究理事会的研究员,也是 PyMC3 与 ArviZ 两个项目的核心开发者,他写的不是转述式的教材,而是一线开发者把自己如何用概率模型解决数据分析问题的心得摊开来给你看。因此书中的方法都非常“可执行”:先明确问题,再写出模型,接着用 PyMC3 采样、用 ArviZ 检查后验、用后验预测检查判断模型靠不靠谱,最后才谈结论。 第2版相较初版几乎是重新组织了一遍:把原书多参数与分层模型相关内容拆解并入更合理的章节顺序,新增 Cox 过程与推断引擎,让内容从“会用模型”推进到“知道估计为何可信”。全彩印刷让代码、后验分布图与可视化结果一目了然,这对自学尤其重要——贝叶斯学习里最卡人的往往不是概念,而是看不出图里那条曲线到底说明什么。每章末尾都配练习,配套代码可在异步社区下载,边读边跑是最合适的用法。需要提醒的是,本书不系统补统计学基础,也不涉及最新版 PyMC 的 API 迁移,读者最好带着一点 Python 与 Jupyter 的使用经验进场,遇到版本差异时以官方文档为准。

Who it's for

A good fit for

  • 已具备一定 Python 基础、希望入门概率编程与贝叶斯建模的数据分析从业者
  • 想用代码理解贝叶斯推断而不是推导公式的学生与科研人员
  • 需要对回归、分类、分层与混合模型做不确定度量化的机器学习工程师
  • 习惯用 Jupyter 边写边跑、愿意完成章末练习的自学者

Not a good fit for

  • 完全没有 Python 编程经验的零基础读者
  • 希望系统学习贝叶斯统计数学推导与频率学派对比的理论派读者
  • 只想查 PyMC 最新版本 API 手册的读者,书中代码基于较旧的 PyMC3

Reading tips

  1. 先配好 Python 环境与 Jupyter,把异步社区下载的配套代码跑通再读正文,避免只看不练。
  2. 第1至2章务必读慢、读透,后验、先验、后验预测检查是后面所有模型的地基。
  3. 每章读完后先自己动手做章末练习,再对照书中模型结构复盘参数含义与诊断图。
  4. 书中基于 PyMC3 的写法与新版 PyMC 存在 API 差异,跑不通时可对照官方文档迁移,思路不受影响。

About the publisher

Posts & Telecom Press China · Founded in 1953

Posts & Telecom Press is known for its strengths in science and technology, computing, and information and communications titles, and has extended its publishing into photography, art, software learning, and inspirational growth, giving it a fairly diverse range. Its catalog includes computing and communications works such as Refactoring and Patterns (Revised Edition) and Huawei Switch Learning Guide (Second Edition), alongside bilingual collector's editions such as The Little Prince (Chinese-English-French illustrated collector's edition), The Great Gatsby, and Three Days to See. Beijing Ten Years: 1980-1990 and Ghost Blade: WLOP Personal Illustration Collection reflect its presence in photography and art. Its authors include Antoine de Saint-Exupéry, Helen Keller, Joshua Kerievsky, Wang Da, Zhang Zhaozeng, and WLOP.

Contents

  1. Chapter 1 Thinking Probabilistically
  2. Chapter 2 Probabilistic Programming
  3. Chapter 3 Modeling with Linear Regression
  4. Chapter 4 Generalized Linear Models
  5. Chapter 5 Model Comparison
  6. Chapter 6 Mixture Models
  7. Chapter 7 Gaussian Processes
  8. Chapter 8 Inference Engines
  9. Chapter 9 Further Learning

FAQ

读这本书需要先学统计学吗?
不需要系统的统计学基础。书中从概率的直观含义讲起,强调用编程与可视化理解概念;但需要一定的 Python 基础,会使用 Jupyter Notebook 并了解 NumPy、pandas 的基本操作会更顺畅。
这本书用的是 PyMC3 还是新版 PyMC?
中译本第2版基于 PyMC3 与 ArviZ 编写,出版于 2023 年。由于 PyMC 后续版本 API 有变化,直接运行书中代码可能遇到兼容问题,建议以官方文档为准做少量迁移,建模思路完全通用。
第1版和第2版有什么区别?
第2版对初版内容做了大幅改写与整合,删去并拆分原“多参数和分层模型”一章、把内容并入更合理的章节,新增 Cox 过程与推断引擎,多数图表由代码生成并采用全彩印刷,页数约 276 页。
书中的代码和数据集怎么获取?
配套源码可在异步社区(epubit.com)本书页面免费下载,书中大部分图表由这些代码直接生成,建议边读边复现,遇到结果不一致时优先检查库版本。
这本书能用来做实际工作项目吗?
可以。它覆盖线性与广义线性模型、分层模型、混合模型、高斯过程与模型比较,并强调后验预测检查与模型诊断,适合把贝叶斯方法用于需要量化不确定性的实际数据分析任务;更复杂的生产部署仍需补充工程与计算性能方面的知识。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

More by the same author

Top rated in the same category