# 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. Commented Feb 16, 2016 at 1:04

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? Commented Feb 16, 2016 at 1:24