# How to calculate the posterior distribution from the density

I'm stuck on a answer from an old exam. The task is to use a Poisson distribution and a Gamma distribution as prior to calculate the posterior density:

$$p(\lambda|x) \propto L(\lambda)p(\lambda)\propto\lambda^{\alpha+n\bar x-1 }e^{-\lambda(\beta+n)}$$ The thing that I do not understand is how this expression can be described as the posterior distribution $$\Gamma(\alpha+n\bar x,\beta+n)$$.

What happens to $$-1$$ in the first exponent and $$-\lambda$$ in the $$\exp(\cdot)$$ ?

The Gamma pdf is $$f(\lambda\mid \tilde\alpha, \tilde\beta) \propto \lambda^{\tilde\alpha -1}\exp(-\tilde\beta \lambda)$$.
So if you plug the quantities $$\tilde\alpha = \alpha + n\bar{x}$$ and $$\tilde\beta = \beta + n$$ you do obtain that $$p(\lambda\mid x) \propto L(\lambda)p(\lambda) \propto \lambda^{\alpha + n\bar{x} -1}\exp\left(-\lambda(\beta + n)\right) = \Gamma(\alpha + n\bar{x}, \beta + n)$$
• pedantic but very important note: gamma pdf is for $\lambda > 0$ so that's why we can jump from the $\propto$ to the full pdf. If this was for a different range of $\lambda$ the result would not hold – jcken Mar 2 at 13:37
• In what context could we have $\lambda \leq 0$ ? The poisson rate is always positive, and so is the realization of the gamma prior. – ArnoV Mar 2 at 13:46
• It could be that we have $\lambda > k > 0$. If this isn't stated then its not strictly valid to make such a jump! Essentially you would be calculating the normalising constant without limits of integration – jcken Mar 2 at 18:34