Contents

Preface

1Probability: A Measurement of Uncertainty

1.1Introduction

1.2The Classical View of a Probability

1.3The Frequency View of a Probability

1.4The Subjective View of a Probability

1.5The Sample Space

1.6Assigning Probabilities

1.7Events and Event Operations

1.8The Three Probability Axioms

1.9The Complement and Addition Properties

1.10Exercises

2Counting Methods

2.1Introduction: Rolling Dice, Yahtzee, and Roulette

2.2Equally Likely Outcomes

2.3The Multiplication Counting Rule

2.4Permutations

2.5Combinations

2.6Arrangements of Non-Distinct Objects

2.7Playing Yahtzee

2.8Exercises

3Conditional Probability

3.1Introduction: The Three Card Problem

3.2In Everyday Life

3.3In a Two-Way Table

3.4Definition and the Multiplication Rule

3.5The Multiplication Rule under Independence

3.6Learning Using Bayes’ Rule

3.7R Example: Learning about a Spinner

3.8Exercises

4Discrete Distributions

4.1Introduction: The Hat Check Problem

4.2Random Variable and Probability Distribution

4.3Summarizing a Probability Distribution

4.4Standard Deviation of a Probability Distribution

4.5Coin-Tossing Distributions

4.5.1Binomial probabilities

4.5.2Binomial computations

4.5.3Mean and standard deviation of a binomial

4.5.4Negative binomial experiments

4.6Exercises

5Continuous Distributions

5.1Introduction: A Baseball Spinner Game

5.2The Uniform Distribution

5.3Probability Density: Waiting for a Bus

5.4The Cumulative Distribution Function

5.5Summarizing a Continuous Random Variable

5.6Normal Distribution

5.7Binomial Probabilities and the Normal Curve

5.8Sampling Distribution of the Mean

5.9Exercises

6Joint Probability Distributions

6.1Introduction

6.2Joint Probability Mass Function: Sampling from a Box

6.3Multinomial Experiments

6.4Joint Density Functions

6.5Independence and Measuring Association

6.6Flipping a Random Coin: The Beta-Binomial Distribution

6.7Bivariate Normal Distribution

6.8Exercises

7Learning about a Binomial Probability

7.1Introduction: Thinking Subjectively about a Proportion

7.2Bayesian Inference with Discrete Priors

7.2.1Example: students’ dining preference

7.2.2Discrete prior distributions for proportion p

7.2.3Likelihood of proportion p

7.2.4Posterior distribution for proportion p

7.2.5Inference: students’ dining preference

7.2.6Discussion: using a discrete prior

7.3Continuous Priors

7.3.1The beta distribution and probabilities

7.3.2Choosing a beta density to represent prior opinion

7.4Updating the Beta Prior

7.4.1Bayes’ rule calculation

7.4.2From beta prior to beta posterior: conjugate priors

7.5Bayesian Inferences with Continuous Priors

7.5.1Bayesian hypothesis testing

7.5.2Bayesian credible intervals

7.5.3Bayesian prediction

7.6Predictive Checking

7.7Exercises

8Modeling Measurement and Count Data

8.1Introduction

8.2Modeling Measurements

8.2.1Examples

8.2.2The general approach

8.2.3Outline of chapter

8.3Bayesian Inference with Discrete Priors

8.3.1Example: Roger Federer’s time-to-serve

8.3.2Simplification of the likelihood

8.3.3Inference: Federer’s time-to-serve

8.4Continuous Priors

8.4.1The normal prior for mean μ

8.4.2Choosing a normal prior

8.5Updating the Normal Prior

8.5.1Introduction

8.5.2A quick peak at the update procedure

8.5.3Bayes’ rule calculation

8.5.4Conjugate normal prior

8.6Bayesian Inferences for Continuous Normal Mean

8.6.1Bayesian hypothesis testing and credible interval

8.6.2Bayesian prediction

8.7Posterior Predictive Checking

8.8Modeling Count Data

8.8.1Examples

8.8.2The Poisson distribution

8.8.3Bayesian inferences

8.8.4Case study: Learning about website counts

8.9Exercises

9Simulation by Markov Chain Monte Carlo

9.1Introduction

9.1.1The Bayesian computation problem

9.1.2Choosing a prior

9.1.3The two-parameter normal problem

9.1.4Overview of the chapter

9.2Markov Chains

9.2.1Definition

9.2.2Some properties

9.2.3Simulating a Markov chain

9.3The Metropolis Algorithm

9.3.1Example: Walking on a number line

9.3.2The general algorithm

9.3.3A general function for the Metropolis algorithm

9.4Example: Cauchy-Normal Problem

9.4.1Choice of starting value and proposal region

9.4.2Collecting the simulated draws

9.5Gibbs Sampling

9.5.1Bivariate discrete distribution

9.5.2Beta-binomial sampling

9.5.3Normal sampling - both parameters unknown

9.6MCMC Inputs and Diagnostics

9.6.1Burn-in, starting values, and multiple chains

9.6.2Diagnostics

9.6.3Graphs and summaries

9.7Using JAGS

9.7.1Normal sampling model

9.7.2Multiple chains

9.7.3Posterior predictive checking

9.7.4Comparing two proportions

9.8Exercises

10Bayesian Hierarchical Modeling

10.1Introduction

10.1.1Observations in groups

10.1.2Example: standardized test scores

10.1.3Separate estimates?

10.1.4Combined estimates?

10.1.5A two-stage prior leading to compromise estimates

10.2Hierarchical Normal Modeling

10.2.1Example: ratings of animation movies

10.2.2A hierarchical Normal model with random σ

10.2.3Inference through MCMC

10.3Hierarchical Beta-Binomial Modeling

10.3.1Example: Deaths after heart attacks

10.3.2A hierarchical beta-binomial model

10.3.3Inference through MCMC

10.4Exercises

11Simple Linear Regression

11.1Introduction

11.2Example: Prices and Areas of House Sales

11.3A Simple Linear Regression Model

11.4A Weakly Informative Prior

11.5Posterior Analysis

11.6Inference through MCMC

11.7Bayesian Inferences with Simple Linear Regression

11.7.1Simulate fits from the regression model

11.7.2Learning about the expected response

11.7.3Prediction of future response

11.7.4Posterior predictive model checking

11.8Informative Prior

11.8.1Standardization

11.8.2Prior distributions

11.8.3Posterior Analysis

11.9A Conditional Means Prior

11.10Exercises

12Bayesian Multiple Regression and Logistic Models

12.1Introduction

12.2Bayesian Multiple Linear Regression

12.2.1Example: expenditures of U.S. households

12.2.2A multiple linear regression model

12.2.3Weakly informative priors and inference through MCMC

12.2.4Prediction

12.3Comparing Regression Models

12.4Bayesian Logistic Regression

12.4.1Example: U.S. women labor participation

12.4.2A logistic regression model

12.4.3Conditional means priors and inference through MCMC

12.4.4Prediction

12.5Exercises

13Case Studies

13.1Introduction

13.2Federalist Papers Study

13.2.1Introduction

13.2.2Data on word use

13.2.3Poisson density sampling

13.2.4Negative binomial sampling

13.2.5Comparison of rates for two authors

13.2.6Which words distinguish the two authors?

13.3Career Trajectories

13.3.1Introduction

13.3.2Measuring hitting performance in baseball

13.3.3A hitter’s career trajectory

13.3.4Estimating a single trajectory

13.3.5Estimating many trajectories by a hierarchical model

13.4Latent Class Modeling

13.4.1Two classes of test takers

13.4.2A latent class model with two classes

13.4.3Disputed authorship of the Federalist Papers

13.5Exercises

14Appendices

14.1Appendix A: The constant in the beta posterior

14.2Appendix B: The posterior predictive distribution

14.3Appendix C: Comparing Bayesian models

Bibliography

Index