Inference of $\lambda$ given $x$, assuming $X\sim {\cal P}_\lambda$

The probability density function of $\lambda$ is evaluated from the so called Bayes' rule:
$\displaystyle f(\lambda\,\vert\,x)$ $\displaystyle \propto$ $\displaystyle f(x\,\vert\,\lambda)\cdot f_0(\lambda)$ (3)
  $\displaystyle \propto$ $\displaystyle \frac{\lambda^{x}\cdot e^{-\lambda}}{x!}\cdot f_0(\lambda) \,,$ (4)

where $f_0(\lambda)$ is the so called `prior'.9 Assuming for the moment a `flat' prior, that is $f_0(\lambda)=k$, and neglecting all factors non depending on $\lambda$, we get
$\displaystyle f(\lambda\,\vert\,x)$ $\displaystyle \propto$ $\displaystyle \lambda^{x}\cdot e^{-\lambda}$ (5)
  $\displaystyle \propto$ $\displaystyle \lambda^{(x+1)-1}\cdot e^{-\lambda}\,,$ (6)

in which we recognize a Gamma pdf with $\alpha=x+1$ and $\beta=1$ (see Appendix A - for a detailed derivation see e.g. Ref. [13]), and therefore
$\displaystyle f(\lambda\,\vert\,x)$ $\displaystyle =$ $\displaystyle \frac{1}{\Gamma(x+1)}\cdot
\lambda^{(x+1)-1}\cdot e^{-\lambda}$ (7)
  $\displaystyle =$ $\displaystyle \frac{\lambda^x\cdot e^{-\lambda}}{x!}\,.$ (8)

Expected value, standard deviation and mode are $x+1$, $\sqrt{x+1}$ and $x$, respectively. The advantage of having expressed the distribution of $\lambda$ in terms of a Gamma is that we can use the probability distributions made available from programming languages, e.g. in R, which usually include also useful random generators (e.g. rgamma() in R). For example, making use of the R function dgamma() we can draw Fig. [*],
Figure: Inferred $f(\lambda\,\vert\,x)$, using a flat prior, for $x=0,1,\ldots,10$.
\begin{figure}\begin{center}
\epsfig{file=esempi_pdf_lambda.eps,clip=,width=\linewidth}
\\ \mbox{} \vspace{-1.0cm} \mbox{}
\end{center}
\end{figure}
which shows $f(\lambda\,\vert\,x)$, for $x=1,2,\ldots,10$, with the following few lines of code:
for (x.o in 0:10) {
  curve(dgamma(x,x.o+1,1),xlim=c(0,20),ylim=c(0,1),col='blue',add=x.o>0,
        xlab=expression(lambda),ylab=expression(paste('f(',lambda,')')))  
}