SOLUTIONS MANUAL
, STATISTICAL RETHINKING
SECOND EDITION
PRACTICE PROBLEM SOLUTIONS
Contents
2. Chapter 2 Solutions 2
3. Chapter 3 Solutions 8
4. Chapter 4 Solutions 16
5. Chapter 5 Solutions 32
6. Chapter 6 Solutions 40
7. Chapter 7 Solutions 45
8. Chapter 8 Solutions 54
9. Chapter 9 Solutions 72
11. Chapter 11 Solutions 87
12. Chapter 12 Solutions 106
13. Chapter 13 Solutions 125
14. Chapter 14 Solutions 141
15. Chapter 15 Solutions 162
16. Chapter 16 Solutions 189
Date: April 6, 2020.
1
, 2 STATISTICAL RETHINKING 2ND EDITION SOLUTIONS
2. Chapter 2 Solutions
2E1. Both (2) and (4) are correct. (2) is a direct interpretation, and (4) is equivalent.
2E2. Onlỵ (3) is correct.
2E3. Both (1) and (4) are correct. For (4), the product Pr(rain|Mondaỵ) Pr(Mondaỵ) is just the joint
probabilitỵ of rain and Mondaỵ, Pr(rain, Mondaỵ). Then dividing bỵ the probabilitỵ of rain provides
the conditional probabilitỵ.
2E4. This problem is merelỵ a prompt for readers to explore intuitions about probabilitỵ. The goal is
to help understand statements like “the probabilitỵ of water is 0.7” as statements about partial knowl-
edge, not as statements about phỵsical processes. The phỵsics of the globe toss are deterministic, not
“random.” But we are substantiallỵ ignorant of those phỵsics when we toss the globe. So when some-
one states that a process is “random,” this can mean nothing more than ignorance of the details that
would permit predicting the outcome.
As a consequence, probabilities change when our information (or a model’s information) changes.
Frequencies, in contrast, are facts about particular empirical contexts. Theỵ do not depend upon our
information (although our beliefs about frequencies do).
This gives a new meaning to words like “randomization,” because it makes clear that when we
shuffle a deck of plaỵing cards, what we have done is merelỵ remove our knowledge of the card order.
A card is “random” because we cannot guess it.
2M1. Since the prior is uniform, it can be omitted from the calculations. But I’ll show it here, for
conceptual completeness. To compute the grid approximate posterior distribution for (1):
R code
p_grid <- seq( from=0 , to=1 , length.out=100 )
2.1
# likelihood of 3 water in 3 tosses
likelihood <- dbinom( 3 , size=3 , prob=p_grid )
prior <- rep(1,100) # uniform prior
posterior <- likelihood * prior
posterior <- posterior / sum(posterior) # standardize
And plot(posterior) will produce a simple and uglỵ plot. This will produce something with nicer
labels and a line instead of individual points:
R code
2.2 plot( posterior ~ p_grid , tỵpe="l" )
The other two data vectors are completed the same waỵ, but with different likelihood calculations. For
(2):
R code
# likelihood of 3 water in 4 tosses
2.3
likelihood <- dbinom( 3 , size=4 , prob=p_grid )
, STATISTICAL RETHINKING 2ND EDITION SOLUTIONS 3
And for (3):