 Given the value of $\lambda$ , the number $X_{i}$ of transactions made by customer $i$ at an online store in a year has a $\mathrm{Poisson}(\lambda)$ distribution, with $X_{i}$ independent of $X_{j}$ for $i\neq j$ . The value of $\lambda$ is unknown. Our prior distribution for $\lambda$ is a gamma(5,1) distribution.  

We observe the numbers of transactions in a year for 45 customers and  

$$
\sum_{i=1}^{45}x_{i}=182.
$$  

(a) Using a $\chi^{2}$ table (i.e. without a computer) find the lower $2.5\%$ point and the upper $2.5\%$ point of the prior distribution of $\lambda$ .(These bound a $95\%$ symmetric prior credible interval).   
(b) Find the posterior distribution of $\lambda$ .  
c) Using a normal approximation to the posterior distribution, based on the posterior mean and variance, find a $95\%$ symmetric posterior credible interval for $\lambda$ .  
(d) Find an expression for the posterior predictive probability that a customer makes ${\boldsymbol{r}}n$ transactions in a year.   
(e) As well as these “ordinary customers,” we believe that there is a second group of individuals. The number of transactions in a year for a member of this second group has, given $\theta$ , a Poisson $(\theta)$ distribution and our beliefs about the value of $\theta$ are represented by a gamma(1,0.05) distribution. A new individual is observed who makes 10 transactions in a year. Given that our prior probability that this is an ordinary customer is 0.9, find our posterior probability that this is an ordinary customer. Hint: You may find it best to calculate the logarithms of the predictive probabilities before exponentiating these. For this you might find the R function lgamma useful. It calculates the log of the gamma function. Alternatively it is possible to do the calculation using the R function dnbinom.  

(N.B. In reality a slightly more complicated model is used in this type of application). 