[Math] Computing the moment-generating function of a compound poisson distribution

moment-generating-functionspoisson distributionprobabilityprobability distributions

Suppose $\lambda > 0$ and $p \in (0, 1)$. The number of fish caught in one day follows a $\operatorname{Poi}(\lambda)$ distribution. At the end of the day, each fish is examined independently. With probability $p$, each fish passes inspection. Let $X$ be the number of fish that pass inspection. What is the moment-generating function of $X$?

The moment-generating function is given by $\operatorname E(e^{tX})$.
I tried applying the law of total expectation knowing that the number of fish gives a partition of the space. This gives
$$
\operatorname E (e^{tX})
=
\sum_{i=0}^\infty
\operatorname E (e^{tX} \mathbin{|} N = i)
\operatorname P ( N = i )
$$
where $N \sim \operatorname{Poi} (\lambda) $ is the number of fish caught in the day.
The expectation under the sum is then exactly the moment-generating function of a binomially distribution variable with number of trials $i$.
So I get,
$$
\sum_{i=0}^\infty
\operatorname E (e^{tX} \mathbin{|} N = i)
\operatorname P ( N = i )
=
\sum_{i=0}^\infty
(1 – p + pe^t)^i e^{-\lambda} \frac{\lambda^i}{i!}
$$
but I'm not sure how to proceed in the evaluation of this series.

One idea I have is to combine the factors to the power $i$ under the sum to try turning the sum into a sum of the probability mass function of $\operatorname{Poi}(\lambda(1 – p + pe^t))$, which will go to one.
\begin{align*}
\sum_{i=0}^\infty
(1 – p + pe^t)^i e^{-\lambda} \frac{\lambda^i}{i!}
&=
e^{-\lambda}
\sum_{i=0}^\infty
\frac{(\lambda(1-p+pe^t))^i}{i!}
\cdot
\frac{e^{-\lambda(1-p+pe^t)}}{e^{-\lambda(1-p+pe^t)}}
\\
&=
e^{-(1-p+pe^t)}
\sum_{i=0}^\infty
e^{-\lambda(1-p+pe^t)}
\frac{(\lambda(1-p+pe^t))^i}{i!}
\\
&=
e^{-(1-p+pe^t)}
\end{align*}

Is this procedure legitimate?
It seems wrong to me as taking the first derivative of the moment-generating function and evaluating at $t=0$ gives $-p$, meaning that the expectation of $X$ would be negative!

Best Answer

I think I see some mistake here, you have $$e^{-\lambda}\cdot e^{\lambda(1-p+pe^t)}=e^{-(1-p+pe^t)},$$ while it should be $$e^{-\lambda(p-pe^t)}.$$

Then the first moment will be $\lambda p.$