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$.


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

  • $\begingroup$ Neither $\pi$ nor $f$ are probability density functions. $\endgroup$
    – whuber
    Apr 15, 2019 at 15:49
  • $\begingroup$ @whuber Do you mean that they don't have to be normalized, or were you trying to correct terminology? $\endgroup$
    – Nownuri
    Apr 15, 2019 at 16:03
  • 1
    $\begingroup$ 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. $\endgroup$
    – whuber
    Apr 15, 2019 at 17:15
  • $\begingroup$ 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. $\endgroup$
    – jbowman
    Apr 16, 2019 at 0:09

1 Answer 1


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).$$

Hence, your posterior should be a gamma distribution:

$$\pi(\theta|x) \propto \theta^x e^{-\theta} \mathbb{I}(\theta>0) \propto \text{Ga}(\theta| x+1,1).$$


Your Answer

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

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