# Finding a posterior distribution from a Poisson likelihood function and a uniform prior distribution

If a counting experiment gives one observation $$x=5$$, and if the prior distribution is given as a uniform function, then is the following a correct way of calculating the posterior function?

First, the posterior can be written as
$$f(\theta|x) \propto f(x|\theta)\pi(\theta)$$

where $$\pi(\theta)$$ is the prior and $$f(x|\theta)$$ is the likelihood function.

Given that $$\pi(\theta)=constant$$, $$f(x|\theta)= \frac{e^{-x}x^{\theta}}{\theta!}$$,

$$f(\theta|x) = k\frac{e^{-x}x^{\theta}}{\theta!}$$

Since $$\Sigma_{\theta=0}^{\infty} k\frac{e^{-x}x^{\theta}}{\theta!} =1$$, $$k=1$$.

Then

$$f(\theta|x=5) = \frac{e^{-5}5^{\theta}}{\theta!}$$

• Neither $\pi$ nor $f$ are probability density functions. – whuber Apr 15 at 15:49
• @whuber Do you mean that they don't have to be normalized, or were you trying to correct terminology? – Nownuri Apr 15 at 16:03
• Neither is normalized. You explicitly claim $f$ is (but it's not) and it's crucial to (at a minimum) specify the domain of $\pi,$ because it's highly ambiguous. – whuber Apr 15 at 17:15
• You are finding the constant of integration by summing over $\theta$ from $0$ to $\infty$. Is $0$ really a valid value for $\theta$? Do you really mean to have the prior on $\theta$ allow for only integer values of $\theta$? Note that your prior, as @whuber observes, doesn't integrate to one. – jbowman Apr 16 at 0:09

Your specified sampling density for the Poisson distribution is incorrect (you have switched the observed value with the parameter). As whuber points out in the comments, you have also been a bit sloppy with specifying the domain and normalisation in some parts. Your model with a single observation $$x$$ should give likelihood and (improper) prior:
$$L_x(\theta) = \theta^x e^{-\theta} \mathbb{I}(\theta > 0) \quad \quad \quad \quad \quad \pi(\theta) \propto \mathbb{I}(\theta>0).$$
$$\pi(\theta|x) \propto \theta^x e^{-\theta} \mathbb{I}(\theta>0) \propto \text{Ga}(\theta| x+1,1).$$