Assume that the number of losses $N$ has a geometric distribution with parameter $p$, while the claim amounts,${\{X_i}\}_{i≥1}$, is a sequence of i.i.d. Gamma distributed r.v. with parameters $a$ and $b$. Find the m.g.f., the mean and the variance of the aggregate claims.
[Note that if $X\sim Gamma(a,b)$ then its m.g.f. is given by $m_X(z)=(\frac{b}{b-z})^a$, while if $X\sim Geometric (p)$, then $P_N(z)=\Bbb{E}(z^N)=\frac{p}{1-qz}$.]
For this question there was no mark scheme so I wanted to check whether I was right or if there was a more efficient way of solving the question.
My solution:
$$ \begin{align} m_S(z)&= \frac{p}{1-qm_X(z)} \\ &=\frac{p}{1-q(\frac{b}{b-z})^a} \\ &=\frac{p(b-z)^a}{(b-z)^a-qb^a} \end{align} $$
To find the expectation and variance we need to workout $E(S)=m'_s(0)=E(X)E(N)$ and $E(S^2)=m_s''(0)$.
*I have skipped the simplification steps to save space and time
$$ \begin{align} m'_s(z)&=\frac{apqb^a(b-z)^{a-1}}{((b-z)^a-qb^a)^2} \\ m'_s(0)&=\frac{apqb^{2a}b^{-1}}{(b^a-qb^a)^2} \\ &=\frac{a}{b}\frac{q}{p}=E(X)E(N)=E(S) \end{align} $$
Which gives us the expectation.
$$ \begin{align} m''_S(z)&=\frac{apqb^a(aqb^a-qb^a+a(b-z)^a+(b-z)^a)(b-z)^{a-2}}{((b-z)^a-qb^a)^3} \\ m''_S(0)&=\frac{apqb^a(aqb^a-qb^a+ab^a+b^a)b^{a-2}}{(b^a-qb^a)^3} \\ &=\frac{aq(a-ap+p)}{b^2p^2} \end{align} $$
Therefore $Var(S)=E(S^2)-E^2(S)$ so we get:
$$ \begin{align} Var(S)&=\frac{aq(a-ap+p)}{b^2p^2}-\frac{a^2q^2}{b^2p^2} \\ &= \frac{a}{b^2}\frac{q}{p} \end{align} $$
The differentiation to do this took quite some time so I was wondering whether there was a more efficient way to solve this to avoid lots of time spent simplifying and differentiating (mainly focussed on the double prime differential to work out the variance).
Any help would be massively appreciated!
Let $$S = \sum_{i=1}^N X_i$$ be the aggregate claims random variable. The gamma MGF implies the $X_i$ are parametrized by shape $a$ and rate $b$, hence $$\operatorname{E}[X_i] = a/b, \quad \operatorname{Var}[X_i] = a/b^2.$$ The geometric PGF implies $N$ has support on $\{0, 1, 2, \ldots\}$, hence $$\operatorname{E}[N] = \frac{1-p}{p}, \quad \operatorname{Var}[N] = \frac{1-p}{p^2}.$$
Then the mean and variance of $S$ are simply $$\operatorname{E}[S] = \operatorname{E}[\operatorname{E}[S \mid N]] = \operatorname{E}[N \operatorname{E}[X_1]] = \frac{a}{b} \operatorname{E}[N] = \frac{a(1-p)}{bp},$$ and $$\begin{align} \operatorname{Var}[S] &= \operatorname{E}[\operatorname{Var}[S \mid N]] + \operatorname{Var}[\operatorname{E}[S \mid N]] \\ &= \operatorname{E}[N \operatorname{Var}[X_1]] + \operatorname{Var}[N \operatorname{E}[X_1]] \\ &= \operatorname{E}[N] \operatorname{Var}[X_1] + \operatorname{E}[X_1]^2 \operatorname{Var}[N] \\ &= \frac{1-p}{p} \frac{a}{b^2} + \frac{a^2}{b^2} \frac{1-p}{p^2} \\ &= \frac{a(1-p)(a + bp)}{b^2 p^2}.\\ \end{align}$$
As for the MGF, this is $$M_S(z) = \operatorname{E}[e^{zS}] = \operatorname{E}[\operatorname{E}[e^{zS} \mid N]] = \operatorname{E}[(M_{X_1}(z))^N] = P_N(M_{X_1}(z)) = \frac{p}{1 - (1-p)(b/(b-z))^a}.$$ In my opinion, the use of this MGF to compute the mean and variance, although possible, is unnecessary and computationally inefficient.