# Posterior from a Poisson likelihood and prior

I have the following Poisson mass function:

$$p(y| \theta) = \frac{\theta^y e^{\theta}}{y!}$$

Which has a corresponding likelihood for n independent realizations of y as follows:

$$\frac{e^{-n\theta}\theta^{\sum^n_{i=1}y_i}}{\prod_{i=1}^ny_i!}$$

Now I have that the prior is $1/\theta$, so I think that the posterior would be: $$p(\theta| y)=\frac{e^{-n\theta}\theta^{(\sum^n_{i=1}{y_i})-1}}{\prod_{i=1}^ny_i!}$$ a. Can you please tell me if this is correct?

I am also supposed to simulate 1000 observations from that posterior in R, but what I don't understand is how to do that. I mean, the posterior is giving me a probability, not an observation, so how I am supposed to create observations from that posterior? I can't use rpois() because because the posterior is not exactly a poisson, is it?

Thank you.

• Is this a question from a course or textbook? If so, please add the [self-study] tag & read its wiki. – gung Feb 16 '16 at 1:04

## 1 Answer

thats not quite correct. Bayes rule gives you $$p(θ|y)=p(y|θ)p(θ)/p(y)$$ so your result is proportional to the posterior (it doesn't have the right normalizing constant). It looks like the posterior will be $$Gamma(\alpha=\sum y_i,\beta=n)$$ See conjugate prior for Poisson

• Thank you. So what you're saying is: $p(\theta| y)\propto\frac{e^{-n\theta}\theta^{(\sum^n_{i=1}{y_i})-1}}{\prod_{i=1}^ny_i!}$. Just curious, since the denominator does not depend of $\theta$, can I drop it and still say that is proportional to the posterior? – user280809 Feb 16 '16 at 1:24
• @user280809 you're asking whether something that is proportional to another thing is still proportional to it if you multiply by a constant? – Glen_b Feb 16 '16 at 1:36
• Yes also note originally I had wrong sign on beta – bdeonovic Feb 16 '16 at 1:42
• Yes, I'm sorry, as you can see my knowledge of statistics is not very good and I am wondering if the denominator is actually a constant since one can change the n but from the tone of your response I assume that it is constant. – user280809 Feb 16 '16 at 1:43
• @bdeonovic Thank you for your patience and help, I appreciate it. – user280809 Feb 16 '16 at 1:44