Account
Computer Science & Technology

Think Bayes

Bayesian Statistics in Python

Think Bayes teaches Bayesian statistics in Python, building every posterior by hand before moving to MCMC and regression.

  • 338pages
  • 20chapters
  • Secondedition

This book is for you if you are

  • a Python programmer who wants Bayesian inference you can implement and inspect
  • a data analyst moving from point estimates to full posterior distributions
  • a student who learns statistics better by writing code than reading proofs

Why this book

Think Bayes is Allen B. Downey's hands-on route into Bayesian statistics, taught through Python code rather than theorem-proof formalism. Published by O'Reilly Media, this second edition keeps the computational-first premise of the Think X series: you learn the ideas by writing small programs that carry out the inference yourself. It matters because Bayesian reasoning is where modern probabilistic modeling, simulation, and uncertainty quantification actually begin.

Most texts on Bayesian inference hand you a formula and a black-box sampler. This one builds the machinery in plain Python first, so conjugate priors, likelihoods, and posterior updates stop being abstract and become things you can inspect, break, and fix. Only after that groundwork does it move into MCMC and Approximate Bayesian Computation.

Strengths readers consistently value here:

  • Code-first exposition — every concept arrives with runnable Python, not pseudocode
  • Twenty chapters that build from Bayes's Theorem to regression and survival analysis
  • Grid algorithms and conjugate priors shown side by side, so approximations stay honest
  • A dedicated chapter on decision analysis, which turns posteriors into actual choices
  • Four chapters on Bayesian regression and classification that bridge into real modeling work

The text assumes basic Python and comfort with probability, and it rewards readers who want to implement rather than cite. If you learn by rebuilding things from scratch, this is your book.

It suits working analysts, data scientists, and students who need Bayesian methods they can defend line by line. Get your copy today.

What you'll learn

  • Apply Bayes's Theorem to estimate proportions and counts from real data
  • Build and compare prior distributions using grid algorithms and conjugate priors
  • Model Poisson processes and interpret rates with uncertainty rather than single numbers
  • Run decision analysis that converts posterior distributions into practical choices
  • Fit Bayesian regression and classification models in Python
  • Perform survival analysis and mark-and-recapture estimation computationally
  • Approximate posteriors with MCMC and Approximate Bayesian Computation when exact forms fail

Not the right book for: readers who want a proof-heavy, measure-theoretic treatment

Questions about this book

Do I need to know Bayesian statistics before starting Think Bayes?

No. The book opens with probability and Bayes's Theorem and builds each method in code, so prior exposure is not required, though basic Python and comfort with probability help.

Which Python libraries does Think Bayes 2nd edition use?

The methods are written in plain Python with the standard scientific stack, and each chapter supplies code you can run and modify to reproduce the results yourself.

How does Think Bayes handle MCMC and Approximate Bayesian Computation?

Both appear near the end, after grid algorithms and conjugate priors have established the underlying ideas, so the approximations are introduced with context rather than as a single black box.

Is Think Bayes a good fit for learning Bayesian regression?

Yes. Four late chapters cover regression, logistic regression, classification, and comparison, all implemented rather than stated as formulas.

Why use computational methods instead of analytic ones to learn Bayesian inference?

Building each posterior numerically makes the assumptions visible and lets you handle problems that lack a closed-form conjugate solution.

Can I get it in another format?

Yes. You get the PDF right away. Need EPUB, Kindle, Word or any other format? Email support@ebooksonline.si with your order number and we send it.

Does it work on Kindle?

Yes. Email support@ebooksonline.si with your order number and we send you a Kindle-ready file.

How many times can I download it?

As many times as you like. Sign in to your account and download it again at any time.

What if the file does not work?

Contact us with your order number and we will fix it or refund you.

Contents

  1. 1Probabilityp. 1
  2. 2Bayes's Theoremp. 17
  3. 3Distributionsp. 29
  4. 4Estimating Proportionsp. 43
  5. 5Estimating Countsp. 57
  6. 6Odds and Addendsp. 69
  7. 7Minimum, Maximum, and Mixturep. 83
  8. 8Poisson Processesp. 99
  9. 9Decision Analysisp. 113
  10. 10Testingp. 129
  11. 11Comparisonp. 145
  12. 12Classificationp. 161
  13. 13Inferencep. 175
  14. 14Survival Analysisp. 191
  15. 15Mark and Recapturep. 207
  16. 16Logistic Regressionp. 223
  17. 17Regressionp. 241
  18. 18Conjugate Priorsp. 257
  19. 19MCMCp. 269
  20. 20Approximate Bayesian Computationp. 287

Details

Author
Allen B. Downey
Publisher
O'Reilly Media, Inc.
Edition
Second edition, 2021
ISBN
9781492089469
Pages
338
Language
English
Formats
PDF (EPUB, Kindle or any other format on request)
File size
19.4 MB
Licence
Personal use, keep forever

Allen B. Downey

Allen B. Downey is the author of Think Bayes and the wider Think X series published by O'Reilly Media.

Buy with confidence

If your file does not open or download, we fix it or refund you. Read the refund policy.

More in Computer Science & Technology

See all
Cover of 10-Minute Focus by Daniel Walter

Get a free ebook

Join the list and get 10-Minute Focus free, plus a short note when new books arrive.

Your cart

No products in the cart.

Subjects

More

Look inside

Sample