Bayesian Quiz1 Solutions
Bayesian Quiz1 Solutions
1. Write down the table of the joint probability mass function for number of young and species. Then
sum entries across the rows and across the columns to get the marginal probabilities.
# Young S1 S2
0 0.06 0.10 0.16
1 0.48 0.22 0.70
2 0.06 0.08 0.14
0.60 0.40 1.00
2. The number of young and the species are dependent. For example,
3. If X ∼ Uniform(10,20),
10 + 20
E[X] = = 15
2
(20 − 10)2
V [X] = = 8.333333
p 12
V [X] 2.886751
CV [X] = = = 0.1924501 ≈ 0.19
E[X] 15
4. Set up a table of marginal probabilities for roadworks or not and conditional densities for travel time.
Yes No
Pr(R) 2/5 3/5
1 1
f (Y |R) 10 5
Y |θ ∼ Binomial (n = 225, θ)
θ ∼ Beta (7, 3)
Given Y =181:
Then
188
E[θ|Y = 181] = = 0.800.
188 + 47
6. Bayes Theorem application:
iid
Yi ∼ Poisson(θ), i = 1, . . . , n
θ ∼ Gamma3, 2
P5
Then given n=5 and i=1 yi = 16,
Then
19
E[θ] = = 2.71
7
Y |θ ∼ Poisson (θ)
θ ∼ Gamma(α, β)
Z ∞ Z ∞ −θ y α
e θ β
Pr(Y = y) = f (y|θ)π(θ)dθ = θα−1 e−θβ dθ
0 0 y! Γ(α)
Z ∞
βα α+y−1 −θ(β+1) βα Γ(α + y)
= θ e dθ =
y!Γ(α) 0 y!Γ(α) (β + 1)α+y
23 Γ(3 + y) 4Γ(3 + y)
Pr(Y = y) = 3+y
=
y!Γ(3) (2 + 1) y!33+y
Then
4Γ(3) 8
Pr(Y = 0) = 3
=
0!3 27
4Γ(4) 8
Pr(Y = 1) = =
1!34 27
4Γ(5) 49
Pr(Y = 2) = =
2!35 243
16
Then probability that Y is at least 1 is Pr(Y = 0) + Pr(Y = 1) = 27 = 0.593.