The populations, $n_{i}$ , and the number of cases, $x_{i}$ , of a disease in a year in each of six districts are given in the table below.  

<html><body><table><tr><td>Population n</td><td>Cases</td><td></td></tr><tr><td>120342</td><td></td><td>2</td></tr><tr><td>235967</td><td></td><td>5</td></tr><tr><td>243745</td><td></td><td>3</td></tr><tr><td>197452</td><td></td><td>5</td></tr><tr><td>276935</td><td></td><td>3</td></tr><tr><td>157222</td><td></td><td>1</td></tr></table></body></html>  

We suppose that the number $X_{i}$ in a district with population $n_{i}$ is a Poisson random variable with mean $n_{i}\lambda/100000$ . The number in each district is independent of the numbers in other districts, given the value of $\lambda$ . Our prior distribution for $\lambda$ is a gamma distribution with mean 3.0 and standard deviation 2.0.  

(a) Find the parameters of the prior distribution.   
(b) Find the prior probability that $\lambda<2.0$ .  
(c) Find the likelihood.   
(d) Find the posterior distribution of $\lambda$ .  
(e) Find the posterior mean and posterior standard deviation of $\lambda$ .  
(f) Plot a graph showing the prior and posterior probability density functions of $\lambda$ on the same axes.   
(g) Find the posterior probability that $\lambda<2.0$ .Notes:   
The probability density function of a $\mathrm{gamma}(a,b)$ distribution is $f(x)\,=\,k x^{a-1}\exp(-b x)$ where $k$ is a constant.  

If $X\sim\operatorname{gamma}(a,b)$ then the mean of $X$ is $\operatorname{E}(X)=a/b$ and the variance of $X$ is $\operatorname{var}(X)=$ $a/(b^{2})$ .If $X\sim\operatorname{gamma}(a,b)$ then you can use a command such as the following in $\mathrm{R}$ to find $\mathrm{Pr}(X<c)$ .  

pgamma(c,a,b)  

To plot the prior and posterior probability densities you may use R commands such as the following.  

lambda<-seq(0.00,5.00,0.01)   
prior<-dgamma(lambda,a,b)   
posterior<-dgamma(lambda,c,d)   
plot(lambda,posterior,xlab=expression(lambda),ylab="Density",type="l")   
lines(lambda,prior,lty=2)  