Poisson distribution given Gamma Distribution I'm struggling with this one:
If $\theta $ is a Gamma$(p,\lambda)$ random variable with
$p>1$ and $\lambda>0$.
We give the density of the gamma distribution:
$ f(x) = \frac {\lambda^p}{\phi(p)} x^{p-1} \exp(-\lambda x) 1_{t>0}$
$\phi (p)$ is referring to the function $\phi$, for which we give:
$\phi(z+1)=z\phi (z) $ for $z>0$, and $\phi (n+1)=n!$.
If $N$ is a random variable such that, given $\theta=t $, $N$ is a Poisson distribution of parameter $t$.


*

*What is the distribution of $N$, $P(N=n)$?.

*What is $E(N)$ ? What is $\operatorname{Var}(N)$?
If I apply the formula of conditional probability, I will have something like this:
$$P(N=n\mid\theta =t)=\frac {\frac {e^{-t} t^n}{n!} \times \frac{\lambda^p}{\phi (p)} t^{p-1} \exp(-\lambda t) 1_{t>0}}{\frac{\lambda^p}{\phi(p)} t^{p-1} \exp(-\lambda t) 1_{t>0}} =\frac {e^{-t} t^n}{n!}  $$
It looks rather strange to me.
It is as if, $\theta $ will cancels itself out on the numerator and denominator and therefore has no influence on the Poisson distribution.
Thanks in advance.
Regards,
 A: The function that you call $\phi$ is usually called $\Gamma,$ the gamma function, and that is what I will call it here.
\begin{align}
& \Pr(N=n) \\[8pt] = {} & \operatorname E\big( \Pr(N=n\mid \theta) \big) \\[8pt]
= {} & \operatorname E\left( \frac{\theta^n e^{-\theta}}{n!} \right) \\[8pt]
= {} & \int_0^\infty \frac{t^n e^{-t}}{n!} \cdot \frac{(\lambda t)^{p-1} e^{-\lambda t} (\lambda\, dt)}{\Gamma(p)} \\[8pt]
= {} & \frac {\lambda^p} {n!\Gamma(p)} \int_0^\infty t^{n+p-1} e^{-(\lambda+1)t} \, dt \\[8pt]
= {} & \frac {\lambda^p} {n!\Gamma(p)}\cdot\frac 1 {(\lambda+1)^{n+p}} \int_0^\infty \big((\lambda+1)t\big)^{n+p-1} e^{-(\lambda+1)t} \big((\lambda+1)\, dt\big) \\[8pt]
= {} & \frac 1 {n!\Gamma(p)} \left( \frac\lambda {\lambda+1} \right)^p \left( \frac 1 {\lambda+1} \right)^n \int_0^\infty u^{n+p-1} e^{-u} \, du \\[8pt]
= {} & \frac {\Gamma(n+p)} {n!\Gamma(p)} \cdot r^p (1-r)^n \\[8pt]
= {} & \frac{p(p+1)(p+2) \cdots (p+n-1)}{n!} r^p (1-r)^n \\[8pt]
= {} & \binom {p+n-1} n r^p (1-r)^n
\end{align}
with $r:=\frac{\lambda}{\lambda+1}$.
So this is a negative binomial distribution.
A: The result is a Negative Binomial distribution.
