If you know how to program, you're ready to tackle Bayesian statistics. With this book, you'll learn how to solve statistical problems with Python code instead of mathematical formulas, using discrete probability distributions rather than continuous mathematics. Once you get the math out of the way, the Bayesian fundamentals will become clearer and you'll begin to apply these techniques to real-world problems.
Bayesian statistical methods are becoming more common and more important, but there aren't many resources available to help beginners. Based on undergraduate classes taught by author Allen B. Downey, this book's computational approach helps you get a solid start.
• Use your programming skills to learn and understand Bayesian statistics
• Work with problems involving estimation, prediction, decision analysis, evidence, and Bayesian hypothesis testing
• Get started with simple examples, using coins, dice, and a bowl of cookies
• Learn computational methods for solving real-world problems
Author(s): Allen B. Downey
Edition: 2
Publisher: O'Reilly Media
Year: 2021
Language: English
Commentary: Vector PDF
Pages: 338
City: Sebastopol, CA
Tags: Probabilistic Models; Decision Analysis; Regression; Python; Bayesian Inference; Classification; Statistics; Probability Theory; Hypothesis Testing; Survival Analysis; Poisson Process; Statistical Inference; Elementary; Monte Carlo Simulations; Markov Chains; Logistic Regression
Copyright
Table of Contents
Preface
Who Is This Book For?
Modeling
Working with the Code
Installing Jupyter
Conventions Used in This Book
O’Reilly Online Learning
How to Contact Us
Contributor List
Chapter 1. Probability
Linda the Banker
Probability
Fraction of Bankers
The Probability Function
Political Views and Parties
Conjunction
Conditional Probability
Conditional Probability Is Not Commutative
Condition and Conjunction
Laws of Probability
Theorem 1
Theorem 2
Theorem 3
The Law of Total Probability
Summary
Exercises
Chapter 2. Bayes’s Theorem
The Cookie Problem
Diachronic Bayes
Bayes Tables
The Dice Problem
The Monty Hall Problem
Summary
Exercises
Chapter 3. Distributions
Distributions
Probability Mass Functions
The Cookie Problem Revisited
101 Bowls
The Dice Problem
Updating Dice
Summary
Exercises
Chapter 4. Estimating Proportions
The Euro Problem
The Binomial Distribution
Bayesian Estimation
Triangle Prior
The Binomial Likelihood Function
Bayesian Statistics
Summary
Exercises
Chapter 5. Estimating Counts
The Train Problem
Sensitivity to the Prior
Power Law Prior
Credible Intervals
The German Tank Problem
Informative Priors
Summary
Exercises
Chapter 6. Odds and Addends
Odds
Bayes’s Rule
Oliver’s Blood
Addends
Gluten Sensitivity
The Forward Problem
The Inverse Problem
Summary
More Exercises
Chapter 7. Minimum, Maximum, and Mixture
Cumulative Distribution Functions
Best Three of Four
Maximum
Minimum
Mixture
General Mixtures
Summary
Exercises
Chapter 8. Poisson Processes
The World Cup Problem
The Poisson Distribution
The Gamma Distribution
The Update
Probability of Superiority
Predicting the Rematch
The Exponential Distribution
Summary
Exercises
Chapter 9. Decision Analysis
The Price Is Right Problem
The Prior
Kernel Density Estimation
Distribution of Error
Update
Probability of Winning
Decision Analysis
Maximizing Expected Gain
Summary
Discussion
More Exercises
Chapter 10. Testing
Estimation
Evidence
Uniformly Distributed Bias
Bayesian Hypothesis Testing
Bayesian Bandits
Prior Beliefs
The Update
Multiple Bandits
Explore and Exploit
The Strategy
Summary
More Exercises
Chapter 11. Comparison
Outer Operations
How Tall Is A?
Joint Distribution
Visualizing the Joint Distribution
Likelihood
The Update
Marginal Distributions
Conditional Posteriors
Dependence and Independence
Summary
Exercises
Chapter 12. Classification
Penguin Data
Normal Models
The Update
Naive Bayesian Classification
Joint Distributions
Multivariate Normal Distribution
A Less Naive Classifier
Summary
Exercises
Chapter 13. Inference
Improving Reading Ability
Estimating Parameters
Likelihood
Posterior Marginal Distributions
Distribution of Differences
Using Summary Statistics
Update with Summary Statistics
Comparing Marginals
Summary
Exercises
Chapter 14. Survival Analysis
The Weibull Distribution
Incomplete Data
Using Incomplete Data
Light Bulbs
Posterior Means
Posterior Predictive Distribution
Summary
Exercises
Chapter 15. Mark and Recapture
The Grizzly Bear Problem
The Update
Two-Parameter Model
The Prior
The Update
The Lincoln Index Problem
Three-Parameter Model
Summary
Exercises
Chapter 16. Logistic Regression
Log Odds
The Space Shuttle Problem
Prior Distribution
Likelihood
The Update
Marginal Distributions
Transforming Distributions
Predictive Distributions
Empirical Bayes
Summary
More Exercises
Chapter 17. Regression
More Snow?
Regression Model
Least Squares Regression
Priors
Likelihood
The Update
Marathon World Record
The Priors
Prediction
Summary
Exercises
Chapter 18. Conjugate Priors
The World Cup Problem Revisited
The Conjugate Prior
What the Actual?
Binomial Likelihood
Lions and Tigers and Bears
The Dirichlet Distribution
Summary
Exercises
Chapter 19. MCMC
The World Cup Problem
Grid Approximation
Prior Predictive Distribution
Introducing PyMC3
Sampling the Prior
When Do We Get to Inference?
Posterior Predictive Distribution
Happiness
Simple Regression
Multiple Regression
Summary
Exercises
Chapter 20. Approximate Bayesian Computation
The Kidney Tumor Problem
A Simple Growth Model
A More General Model
Simulation
Approximate Bayesian Computation
Counting Cells
Cell Counting with ABC
When Do We Get to the Approximate Part?
Summary
Exercises
Index
About the Author
Colophon