[Math] Find the posterior distribution for an exponential prior and a Poisson likelihood

bayesianprobabilityprobability distributionsstatistics

I have a prior $\lambda \sim \exp(1)$ and a likelihood $X \sim poisson(\lambda)$, and I observed in a sample of $n=5$ a mean of $3$. What is the posterior distribution of $\lambda$?

Here is my asnwer:

$f(x|\lambda) = \frac{\lambda^{x}e^{-\lambda}}{x!}$
$f(\lambda) = \theta e^{-\theta \lambda}, \theta = 1 => f(\lambda) = e^{-\lambda }$

So, the posterior:

$f(\lambda|x) \propto e^{-\lambda} \lambda^{x} e^{-\lambda +(-\lambda)} = \lambda^{x}e^{-2 \lambda} $

This posterior is some known distribution (e.g. exponential)?

Best Answer

Assume one observed $x=(x_k)_{k\leqslant n}$, then $f(x\mid\lambda)=f(x_1\mid\lambda)\cdots f(x_n\mid\lambda)\propto\lambda^{|x|}\mathrm e^{-n\lambda}$ where $|x|=x_1+\cdots+x_n$ and $\propto$ refers to the fact that one omits multiplicative constants independent of $\lambda$. Thus, $f(\lambda\mid x)\propto f(\lambda)f(x\mid\lambda)\propto\lambda^{|x|}\mathrm e^{-(n+1)\lambda}$. To find the normalizing constant, recall that, for every positive $u$ and $v$, $$ \int_0^\infty\lambda^{u-1}\mathrm e^{-v\lambda}\mathrm d\lambda=v^{-u}\Gamma(u), $$ hence, finally, $$ f(\lambda\mid x)=(n+1)^{-|x|-1}\,(|x|)!\,\lambda^{|x|}\mathrm e^{-(n+1)\lambda}. $$ This is the gamma distribution with parameters $(n+1,|x|+1)$.