Need some help.

Assume the sampling distribution is Poisson with sample size $n$.

Assume constant prior distribution.


$L(\lambda | \mathbb{x})=\prod_{i=1}^{n}\dfrac{e^{-\lambda}\lambda^{x_{i}}}{x_{i}!}=\dfrac{e^{-n\lambda}\lambda^{\sum_{i=1}^{n}x_{i}}}{\prod_{i=1}^{n}x_{i}!}$

Prior: $p(\lambda)=\frac{1}{a}$, $a$ is some real constant.

Therefore, posterior:

$\pi(\lambda | \mathbb{x})=\dfrac{e^{-n\lambda}\lambda^{\sum_{i=1}^{n}x_{i}}}{\prod_{i=1}^{n}x_{i}!}\cdot\dfrac{1}{a}$

$\pi(\lambda | \mathbb{x})\propto e^{-n\lambda}\lambda^{\sum_{i=1}^{n}x_{i}}$

Is this correct? And if so, is there no nice posterior for the Poisson/constant?


3 Answers 3


The posterior with such an improper prior is a gamma distribution and you can pretty much read off the parameter values from what you wrote down. And yes, your derivation seems right.

  • $\begingroup$ I was uncertain if this was homework, but if an improper prior was intended, why specifically write $1/a$? (This is why I thought perhaps a uniform prior $[0,a]$ was intended.) $\endgroup$
    – GeoMatt22
    Sep 17, 2016 at 8:02

This looks mostly reasonable to me, but your terminology is a bit loose, and I believe there is also one mathematical oversight. My understanding of the problem would be as follows.

First, applying Bayes theorem to the Poisson parameter $\lambda$ and the data $\mathbb{x}$ gives the posterior formally as $$p(\lambda \mid \mathbb{x})=\frac{p(\mathbb{x} \mid \lambda)p(\lambda)}{p(\mathbb{x})} \,,\, p(\mathbb{x})=\int_0^{\infty}{p(\mathbb{x} \mid \lambda)p(\lambda)d\lambda}$$ where the integral for the normalization factor $p(\mathbb{x})$ is over all possible $\lambda\in\mathbb{R}^+$.

Then, assuming i.i.d. data $\mathbb{x}\in\mathbb{N}^n$, your expression for the data likelihood appears to be correct, and is equivalent to $$p(\mathbb{x} \mid \lambda)=\frac{(e^{-\lambda}\lambda^{\bar{x}})^n}{\Omega}\,,\, \bar{x}=\frac{1}{n}\sum_{i=1}^nx_i\,,\,\Omega=\prod_{i=1}^{n}x_{i}!$$ where $\Omega$ just collects the factors that do not depend on $\lambda$.

Next we must consider the prior $p(\lambda)$, and this is where I believe your mathematical oversight occurs. For a generic Poisson distribution, we know $\lambda\in\mathbb{R}^+$. The prior you give, when interpreted literally, does not give a valid PDF over $\mathbb{R}^+$ (i.e. it integrates to $\infty$). So really the implied prior is a uniform PDF over $[0,a]$, i.e. $$p(\lambda)=\frac{\mathbb{1}_{\lambda\in[0,a]}}{a}$$ where the notation $\mathbb{1}_C$ is an indicator function that is $1$ when condition $C$ holds, and $0$ otherwise.

Combining the above, the posterior would then be $$p(\lambda \mid \mathbb{x})=\frac{(e^{-\lambda}\lambda^{\bar{x}})^n}{\int_0^a{(e^{-\lambda}\lambda^{\bar{x}})^nd\lambda}}\mathbb{1}_{\lambda\in[0,a]}$$

(Warning: I am probably out of my depth, so may be wrong here!)


The likelihood function can be write as:

$L(\mathbb{x}|\lambda) \propto \prod_{i=1}^N e^{\lambda}x^{x_i}$

$\propto$ means you can ignore the normalize constant at this step.

Prior: $p(\lambda) \propto \frac{1}{a} \propto 1$

Therefore, the posterior distribution is:

$\pi(\lambda | \mathbb{x}) \propto L(\mathbb{x}|\lambda) \times p(\lambda)$

$\pi(\lambda | \mathbb{x}) \propto e^{N\lambda}x^{\sum_{i=1}^Nx_i}$

If you are going to just write down the Bayes rule, then it is like this. But if you want to implement MCMC, then you need to consider if a non-informative prior is proper.

  • 1
    $\begingroup$ You presumably mean that the OP needs to check whether the posterior is proper? The prior is not unless a fixed $a \in (0, \infty)$ is chosen. In this particular case $N\geq 1$ already ensures a proper posterior. $\endgroup$
    – Björn
    Sep 18, 2016 at 6:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.