4. The number of customers to a small restaurant in Dublin is thought to follow
a Poisson distribution with parameter $\lambda$. Prior knowledge suggests that the
mean number of customers per day is 10 and that the variance is 5.
Over a 10 day period the number of customers who visited the restaurant was
as follows: 14, 10, 12, 6, 9, 13, 7. The distribution of the number of customers
who visit the restaurant each day can be assumed to be independent and
identically distributed.
(i) You should use a gamma distribution for the prior distribution of $\lambda$. Using
the prior knowledge of the mean number of customers per day, what
parameters should you use for the prior distribution?
(ii) Derive the posterior distribution of $\lambda$ given the observed data. Explain
clearly the steps in your derivation.
(iii) The manager of the restaurant suggests that it is unlikely that the average
number of customers who visit the restaurant on any given day exceeds
12. Assess how you would assess this hypothesis using R. (You don't need
to provide a numerical answer, just the R command needed.)
(iv) How reasonable do you think the independent and identically distributed
assumption is? Explain your reasoning.