How do you calculate the mean and variance of a random var with a distribution function that has a parameter with its own distribution function? [duplicate]

I am busy with ruin theory.

$$S(t) = \sum_{i=1}^{N(t)} X_i$$

$S(t)$ is the aggregate claim size after $t$ years, where $X_i$ is the individual claim size (with mean and variance given) and $N(t)$ is the number of claims that follow a Poisson distribution with parameter $\lambda$, and it is assumed that $\lambda$ has an exponential distribution with given mean.

Now since $N(t)$ has a Poisson distribution, $S(t)$ has a Compound Poisson distribution with parameter $\lambda$, right?

Then is the expected value of $S(t)$:

$E[S(t)] = E[N(t)]\cdot E[X_i]$
$\,\:\quad\qquad = (E[\lambda]\cdot t)\cdot E[X_i]\,$ ?

I am specifically confused about the $E[N(t)]$ part, does it include the $t$ variable even though it is only distributed Poisson($\lambda$) or not? And then do you use $E[\lambda]$ or only $\lambda$ in calculating the $E[N(t)]$?

Also, the variance of $N(t)$, is it equal to the variance of $\lambda$ or the expected value of $\lambda$? And again should it be multiplied by $t$ even though $t$ is not given as part of the parameter in the question?

• Your description is missing the connection between $S(t)$, $N(t)$ and the $X_i$'s. Can you please include it? It could also help you in understanding the inequality. (The Wikipedia entry on Compound Poisson distributions is quite helpful towards resolving your interrogations.) Oct 26 '15 at 8:20
• Thank you @Xi'an! I edited that into the question, S(t)=Sum of the Xi's from i=1 to N(t) Oct 26 '15 at 18:10

Generally, the parameter of a Poisson distribution is defined as the distribution mean. However, for ruin theory, the expected number of claims increases with time, and should not be equal for different times, as having a time-independent $\lambda$ would imply. It is more likely that $\lambda$ is the rate parameter of the Poisson process $N(t)$, then $S(t)$ is a compound Poisson process with rate $\lambda$.
Following the linked article, $E[S(t)]$ is as given by the OP. The last step requires another application of the law of total expectation: $$E[N(t)]=E[E[N(t)|\lambda]]=E[\lambda t]=E[\lambda]t$$ since $\lambda$ is not constant but random.
The variance of $N(t)$ is given by the law of total variance: $$Var[N(t)]=E[Var[N(t)|\lambda]]+Var[E[N(t)|\lambda]]=E[\lambda t]+Var[\lambda t]=E[\lambda]t+(E[\lambda]t)^2$$ since $\lambda$ is exponentially distributed.
In the definition of the compound Poisson process, there is an underlying assumption that, as hinted by @Xian, the random variables $$X_{i}$$'s are i.i.d. as well as independent of $$N(t)$$. To compute $$E[S(t)]$$, consider $$\begin{eqnarray*} % \nonumber to remove numbering (before each equation) E\left[S(t)|N(t)=n\right] &=& E\left[X_{1}+X_{2}+\cdots +X_{N(t)}|N(t)=n\right] \\ &=& E\left[X_{1}+X_{2}+\cdots +X_{n}\right]\\ & & \quad\quad\quad\quad\quad\mbox{ since X's and N(t) are independent RV's}\\ &=& n E[X], \quad\quad\mbox{ since X_{i}'s are iid RV's} \end{eqnarray*}$$ Multiplying on both sides by $$P\left\{N(t)=n\right\}$$ and taking summation over all possible values of $$n$$, we get, $$\begin{eqnarray*} E\left[S(t)\right] &=& \sum_{n}\underbrace{E\left(S(t)|N(t)=n\right)}_{n\cdot E[X]} P\left\{N(t)=n\right\}\\ &=& \sum_{n} n\cdot E[X]\cdot P\left\{N=n\right\}\\ &=&E(X)\cdot \sum_{n}n\cdot P\left\{N=n\right\}\\ E\left[S(t)\right] &=& E[X]\cdot E[N(t)] = (\lambda t) \cdot E[X] \end{eqnarray*}$$ since $$\{N(t), t\geq 0\}$$ is Poisson process, $$E[N(t)] = \lambda t$$.
In order to find an expression for $$Var[S(t)]$$, first find the second conditional moment of $$S(t)$$. $$\begin{eqnarray*} E(S(t)^{2}|N(t)=n) &=& E[(X_{1}+X_{2}+\cdots +X_{N(t)})^{2}|N(t)=n] \\ &=& E[(X_{1}+X_{2}+\cdots +X_{n})^{2}]\\ &=& E\left\{\sum_{i=1}^{n}X_{i}^{2}+2\sum_{i Now $$\begin{eqnarray*} Var(S(t)) &=& E(S(t)^{2}) - \left[E(S(t))\right]^{2} \\ &=& \sum_{n}E(S(t)^{2}|N(t)=n)P\{N(t)=n\}-[E(X)E(N(t))]^{2}\\ &=&\sum_{n}\left[nVar\left(X\right)+n^{2}\left(E\left(X\right)\right)^{2}\right] P\left\{N(t)=n\right\} -\left[E(X)E(N(t))\right]^{2}\\ &=& Var(X) \sum_{n}nP\left\{N(t)=n\right\} + \left(E\left(X\right)\right)^{2}\sum_{n}n^{2}P\left\{N(t)=n\right\} - \left[E(X)E(N(t))\right]^{2}\\ &=&E(N(t))Var(X) + \left(E\left(X\right)\right)^{2} \left[E(N(t)^{2})-(E(N(t)))^{2}\right]\\ & = & E[N(t)\cdot Var[X] + Var[N(t)]\cdot (E[X])^{2}\nonumber\\ & =& \lambda t\cdot Var[X] + \lambda t\cdot (E[X])^{2}\nonumber\\ &=& \lambda t\cdot [Var[X] + (E[X])^{2}]\nonumber\\ Var[S(t)]&=& \lambda t\cdot E[X^{2}] \end{eqnarray*}$$