Set: Problems class, Friday 21st February 2025.
Due in: Problems class, Friday 28th February 2025. Paper copies may be submitted in the problems class or directly to me in lectures or my office, 4W4.10. PDF copies may be submitted to the portal available on the Moodle page.
Task: Attempt questions 1-2; questions 3-4 are extra questions which may be discussed in the problems class.
Let X1,…,Xn be conditionally independent given λ so that f(x|λ)=∏ni=1f(xi|λ) where x=(x1,…,xn). Suppose that λ∼Gamma(α,β) and Xi|λ∼Exp(λ) where λ represents the rate so that E(Xi|λ)=λ−1.
Show that λ|x∼Gamma(α+n,β+nˉx).
Show that the posterior mean for the failure rate λ can be written as a weighted average of the prior mean of λ and the maximum likelihood estimate, ˉx−1, of λ.
A water company is interested in the failure rate of water pipes.
They ask two groups of engineers about their prior beliefs about the
failure rate. The first group believe the mean failure rate is 18 with coefficient of variation
1√11, whilst the
second group believe the mean is 111 with coefficient of
variation 12.
[Note:
The coefficient of variation is the standard deviation divided by the
mean.]
Let Xi be the time
until water pipe i fails and assume
that the Xi follow the
exponential likelihood model described above. A sample of five of pipes
is taken and the following times to failure were observed: 8.2, 9.2, 11.2, 9.8, 10.1.
Find the appropriate members of the Gamma families the prior statements of the two groups of engineers represent. In each case find the posterior mean and variance. Approximating the posterior by N(E(λ|x),Var(λ|x)), where x=(x1,…,x5), estimate, in each case, the probability that the failure rate is less than 0.1.
How do you expect any differences between the engineers to be reconciled as more data becomes available?
Let x be the number of successes in n independent Bernoulli trials, each one having unknown probability θ of success. It is judged that θ may be modelled by a Unif(0,1) distribution so f(θ)=1, 0<θ<1. An extra trial, z is performed, independent of the first n given θ, but with probability θ2 of success. The full data is thus (x,z) where z=1 if the extra trial is a success and 0 otherwise.
Show that f(θ|x,z=0)=c{θα−1(1−θ)β−1+θα−1(1−θ)β} where α=x+1, β=n−x+1 and c=1B(α,β)+B(α,β+1).
Hence show that E(θ|X,Z=0)=(x+1)(2n−x+4)(n+3)(2n−x+3). [Hint: Show that c=α+βB(α,β)(α+2β) and work with α and β.]
Show that, for all x, E(θ|X,Z=0) is less than E(θ|X,Z=1).
Let X1,…,Xn be conditionally independent given θ, so f(x|θ)=∏ni=1f(xi|θ) where x=(x1,…,xn), with each Xi|θ∼N(μ,θ) where μ is known.
Let s(x)=∑ni=1(xi−μ)2. Show that we can write f(x|θ)=g(s,θ)h(x) where g(s,θ) depends upon s(x) and θ and h(x) does not depend upon θ but may depend upon x. The equation shows that s(X)=∑ni=1(Xi−μ)2 is sufficient for X1,…,Xn for learning about θ.
An inverse-gamma distribution with known parameters α,β>0 is judged to be the prior distribution for θ. So, f(θ)=βαΓ(α)θ−(α+1)e−β/θ, θ>0.
Show that the distribution of the precision τ=1θ is Gamma(α,β).
Find the posterior distribution of θ given x=(x1,…,xn).
Show that the posterior mean for θ can be written as a weighted average of the prior mean of θ and the maximum likelihood estimate, s(x)/n, of θ.
Suppose that X1,…,Xn are identically distributed discrete random variables taking k possible values with probabilities θ1,…,θk. Inference is required about θ=(θ1,…,θk) where ∑kj=1θj=1.
Assuming that the Xis are independent given θ, explain why f(x|θ)∝k∏j=1θnjj where x=(x1,…,xn) and nj is the number of xis observed to take the jth possible value.
Suppose that the prior for θ is Dirichlet distributed with known parameters a=(a1,…,ak) so f(θ)=1B(a)k∏j=1θaj−1j where B(a)=B(a1,…,ak)=∏kj=1Γ(aj)Γ(∑kj=1aj). Show that the posterior for θ given x is Dirichlet with parameters a+n=(a1+n1,…,ak+nk).