# Finding posterior with Ga prior, Exp likelihood

I'm using this 2017-2018 exam paper to pre-study for a module in Bayesian Statistics. It has a question,

Assume that the waiting time, $$t$$, of a client in a bank can be modelled with an exponential distribution with unknown parameter $$\lambda$$, $$f(t\,|\,\lambda)=\lambda\exp[-\lambda t], \hspace{1em} \lambda>0,$$ and that the prior distribution is Gamma with parameters $$(a,b)$$, $$\pi(\lambda)=\frac{b^a}{\Gamma[a]}\lambda^{a-1}\exp[-b\lambda], \hspace{1em} a,b>0.$$ An average waiting time, $$\bar{t}=3.8$$, is recorded from observing $$20$$ clients at random. Show that the prior is conjugate and provide the posterior parameters.

The prior parameters $$(a,b)$$ are to be found in a previous part of the question, given $$\mathbb{E}[\lambda]=0.2, \hspace{1em} \mathbb{V}[\lambda]=1,$$ and I got $$a=0.04,\hspace{1em}b=0.2.$$

For the rest, here's my reasoning so far.

\begin{align*} & \begin{aligned}[t] f(\textbf{t}\,|\,\lambda) & = \prod_{i=1}^{20}\lambda\exp[-\lambda t_i] \\ & = \lambda^{20}\exp\left[-\lambda\sum_{i=1}^{20}t_i\right] \\ & = \lambda^{20}\exp[-\lambda(20\times3.8)] \\ & = \lambda^{20}\exp[-76\lambda] \end{aligned} \\[1em] \therefore \; & \begin{aligned}[t] \pi(\lambda\,|\,\textbf{t}) & \propto \pi(\lambda)f(\textbf{t}\,|\,\lambda) \\ & = \frac{0.2^{0.04}}{\Gamma[0.04]}\lambda^{20.04}\exp[-76.2\lambda] \\ & \propto \frac{(a^\ast)^{b^\ast}}{\Gamma[a^\ast]}\lambda^{a^\ast-1}\exp[-b^\ast\lambda], \hspace{1em} \text{where } a^\ast = 21.04, \; b^\ast = 76.2 \end{aligned} \\[1em] \therefore \; & \begin{aligned}[t] \pi(\lambda\,|\,\textbf{t}) = \text{Ga}[21.04,76.2]. \end{aligned} \end{align*} Am I right?

• The answer should be Ga(0.04 + 20, 0.2 + 20*3.8) = Ga(20.04, 76.2) assuming the shape-rate-parameterization of the Gamma that you are using. Sep 26 at 7:06
• @Björn Right; I shouldn't have added the $1$. Thanks.
– mjc
Sep 26 at 7:08