Preface
- How To Read This Book
- Running the Examples
- Acknowledgments
Introduction
- Why Study Probability?
- What This Book Covers
- A Note on the Code
- How Probability Connects to the Rest of Mathematics
Basic Probability
- A Brief History
- Interpretations of Probability
- Sample Spaces and Events
- Set Operations on Events
- The Event Space and the Probability Triple
- The Kolmogorov Axioms
- The Classical Definition of Probability
- The Complement Rule
- Running the Example
- Why This Matters
- Problem Set
Conditional Probability
- Why Conditional Probability?
- The Definition of Conditional Probability
- The Multiplication Rule and the Chain Rule
- Independence
- The Law of Total Probability
- Bayes’ Theorem
- Simpson’s Paradox
- Running the Example
- Why This Matters
- Problem Set
Discrete Random Variables
- From Events to Random Variables
- What Is a Random Variable?
- Indicator Random Variables
- The Probability Mass Function
- The Cumulative Distribution Function
- Expected Value
- Variance and Standard Deviation
- Standardization
- Moments and the Moment Generating Function
- Concentration Inequalities
- Three Example Distributions
- Additional Computations in the Program
- Running the Example
- Why This Matters
- Problem Set
Binomial and Geometric Distributions
- Bernoulli Trials
- The Binomial Distribution
- The Geometric Distribution
- The Memoryless Property
- Other Distributions from Bernoulli Trials
- Real-World Applications
- Running the Example
- Why This Matters
- Problem Set
Continuous Distributions
- Why Continuous Random Variables?
- From Probability Mass to Probability Density
- Expectation and Variance for Continuous Variables
- Numerical Integration
- The Uniform Distribution
- The Exponential Distribution
- The Normal Distribution
- Other Named Continuous Distributions
- The Maximum Entropy Viewpoint
- Transformations of Random Variables
- Why This Matters
- Problem Set
Law of Large Numbers
- Historical Roots
- The Sample Mean
- The Weak Law of Large Numbers
- The Strong Law of Large Numbers
- Modes of Convergence
- When the Law of Large Numbers Fails
- Why This Matters
- The Simulation
- Running the Example
- A Practical Observation
- Problem Set
Central Limit Theorem
- A Brief History
- The Theorem
- Why This Is Remarkable
- Why It Is True: A Sketch via Generating Functions
- Rate of Convergence: Berry-Esseen
- The Simulation
- Running the Example
- The Theoretical Basis for Statistical Practice
- How Large Does n Need to Be?
- Beyond i.i.d.: Extensions of the CLT
- Why This Matters
- Problem Set
Monte Carlo Methods
- A Short History
- The Core Idea
- Monte Carlo Integration
- Estimating Pi
- Standard Error
- Running the Example
- The Cost of Monte Carlo
- Variance Reduction
- Quasi-Random Sequences
- Buffon’s Needle: An Older Pi Estimator
- Applications Beyond Pi
- Why This Matters
- Problem Set
Bayesian Inference
- Two Paradigms of Statistics
- The Bayesian Framework
- The Choice of Prior
- Conjugate Priors
- The Update Rule
- Point Estimates and Credible Intervals
- Prediction: The Posterior Predictive
- The Example: Estimating a Coin’s Bias
- Running the Example
- The Laplace Rule of Succession
- Prior Sensitivity
- Why This Matters
- Problem Set
Markov Chains
- Andrey Markov and the Origin of Markov Chains
- The Markov Property
- A Weather Model
- Evolving the Distribution
- Classification of States
- The Stationary Distribution
- Finding the Stationary Distribution
- Why the Chain Converges: The Spectral View
- Running the Example
- Hitting Times and First-Step Analysis
- Applications of Markov Chains
- Beyond Discrete Time
- Why This Matters
- Problem Set
An Embedded Probabilistic Programming Language
- What Inference Computes
- Unconstrained Space and the Jacobian
- Three Ways to Find the Posterior
- Forward-Mode Automatic Differentiation
- The Distribution Library
- Support Transforms
- The Model DSL: defmodel, sample, observe
- The Example Data
- The Three Inference Engines
- Diagnostics: ESS and R-hat
- Running the Example
- Wrap Up
- Problem Set
Wrapping Up
- The Arc of the Book
- Where To Go From Here
- The Value of Implementation
- Final Thoughts
Further Reading
- General Probability and Measure
- Statistics, Bayesian Methods, and Machine Learning
- Markov Chains and Monte Carlo
- Papers Behind Chapter 11
- Special Functions