# Finding the mgf, expectation and variance of random sum of Poisson random variables

Question

Consider the random sum $$Y = I(N>0)\sum_{n=1}^{N}X_n$$

where $$\left(X_n \right)_{n\geq 1}$$ is a sequence of independently and identically distributed random variables that is independent of the random variable $$N$$ which has a Poisson distribution with parameter $$\lambda$$, and $$I(N> 0)$$ is the indicator function for the event $$[N > 0]$$. Assume each $$X_n$$ has MGF $$M_X(t)$$.

1. By using a suitable conditioning argument or otherwise, find $$M_Y (t)$$, the MGF of Y.

2. By finding appropriate derivatives of $$M_Y(t)$$, calculate the mean and variance of Y.

HINT: Recall that the chain rule states that if $$u(x)=g(w(x))$$, then $$u'(x) = w'(x)g'(w(x))$$.

1. Check your answers to Question 2 by calculating $$\mathbb{E}[Y]$$ and $$Var[Y]$$ using a simpler and more direct method.

My attempt

1. \begin{aligned} M_Y(t)& = \mathbb{E}(e^{tY})\\ & = \mathbb{E}\left[\mathbb{E} \left( e^{t \sum_{n=1}^N X_n} \vert N = j \right)\right]\\ & = \mathbb{E}\left[\mathbb{E}\left( e^{t \sum_{n=1}^j X_n} \right)\right]\\ & = \mathbb{E} \left[ (M_X(t))^j \right] \end{aligned}

Now I am stuck. Is my attempt for Question 1 is correct? If it is, how should I continue with Questions 2 and 3?

Any intuitive explanations will be highly appreciated!

• What is the law of $N$ ? Is it poisson as well ?
– Surb
Commented Nov 4, 2023 at 8:35

It's not necessary to write $$N = j$$ explicitly. The law of total expectation is $$M_Y(t) = \mathbb{E}[e^{tY}] = \mathbb{E}[\mathbb{E}[e^{tY} \mid N]].$$ The innermost expectation is conditioned on $$N$$, so is a function of the random variable $$N$$. We note $$\mathbb{E}[e^{tY} \mid N] = \mathbb{E}[e^{t\sum_{i=1}^N X_i} \mid N] = \mathbb{E}\left[\prod_{i=1}^N e^{tX_i} \,\Biggl|\, N \Biggr. \right] \overset{\text{iid}}{=} \prod_{i=1}^N M_X(t) = M_X(t)^N.$$ (It is worth mentioning at this step that if $$N = 0$$, then $$M_X(t)^N = 1$$ which is consistent with the definition of $$Y$$, so there is no further need for the indicator function.) From here, we now must compute $$\mathbb{E}[M_X(t)^N],$$ where the expectation is taken with respect to the random variable $$N$$. To this end, we note that if $$N \sim \operatorname{Poisson}(\lambda),$$ then $$\operatorname{E}[z^N] = \sum_{n=0}^\infty z^n \Pr[N = n] = \sum_{n=0}^\infty z^n e^{-\lambda} \frac{\lambda^n}{n!}.$$ I leave the remainder of this calculation as an exercise.

Then, all that remains is to let $$z = M_X(t)$$ after evaluating the above sum. The result furnishes the desired MGF of $$Y$$.

The rest of the question should be straightforward once you have calculated the MGF of $$Y$$, since for each positive integer $$k$$,

$$\mathbb{E}[Y^k] = \frac{d^k}{dt^k}\left[M_Y(t)\right]_{t=0};$$ that is to say, the $$k^{\rm th}$$ raw moment of $$Y$$ equals the $$k^{\rm th}$$ derivative of the MGF of $$Y$$ evaluated at $$0$$. The choice $$k = 1$$ yields $$\mathbb{E}[Y]$$ and the variance is calculated using the second moment minus the square of the first moment; i.e., $$\operatorname{Var}[Y] = \mathbb{E}[Y^2] - \mathbb{E}[Y]^2$$.

As for the "simpler and more direct" method described in part 3, how would you do this? My suggestion is to use the linearity of expectation:

$$\mathbb{E}[Y] = \mathbb{E}[\mathbb{E}[X_1 + \cdots + X_N \mid N]] = \ldots,$$

and the law of total variance:

$$\operatorname{Var}[Y] = \operatorname{Var}[\mathbb{E}[Y \mid N]] + \mathbb{E}[\operatorname{Var}[Y \mid N]].$$

\begin{aligned} M_Y(t)-1& = \mathbb{E}(e^{tY})-1\\ & = \sum_{j>1}\mathbb{E}\left[\mathbb{E} \left( e^{t \sum_{n=1}^N X_n} \vert N = j \right)\right]P(Y=j)\\ & = \sum_{j\ge 1 }\left[\mathbb{E}\left( e^{t \sum_{n=1}^j X_n} \right)\right]e^{-\lambda} \frac {\lambda^{j}} {j!}\\ & = e^{\lambda (M_X(t)-1)}-1\end{aligned}

I will let you differentiate this to get the answer for 2).

For 3) condition on $$N$$ and use the fact that the mean of a sum is the sum of the means and variance of a sum of independent random variables is the sum of the variances.

• The sum cannot exclude the case $j = 0$ because there is a positive probability that $N = 0$. Another way to see the error is to note that a well-defined MGF must be $1$ at $t = 0$, since $M_Y(0) = \mathbb{E}[e^{0 \cdot Y}] = \mathbb{E}[e^0] = 1$. Your MGF does not: $$e^{\lambda(M_X(0)-1)} - 1 = 0 \ne 1.$$ Commented Nov 4, 2023 at 8:52
• @heropup I wanted to start with $M_Y(t)-1$. I have corrected the answer. Thanks for your comment. Commented Nov 4, 2023 at 8:55