I have a series of $X_i$ random variables, identically and independent distributed. $S_n=\sum_i^N X_i$, with $N$ which has a Poisson distribution and is independent from $X_i$.
I have to compute the characteristic function.
I tried to apply the law of iterated expectation:
$E[e^{it \sum_i^N X_i}]=E[E[e^{it\sum_i^N X_i}|N]]=E[N]E[e^{it\sum_i^N X_i}] =E[N]\prod_i^NE[e^{itX_i}]$
is that correct?
Suppose $X_i$'s characteristic function is $f(t) = E(e^{itX_i})$, then
\begin{align} E(e^{it\sum_{i=1}^N X_i}) &= E(E(e^{it\sum_{i=1}^N X_i}|N)) \\ & = E(\prod_{i=1}^NE(e^{itX_i})) \\ & = E(f^N(t)) \\ & = e^{-\lambda}\sum_{k=0}^{+\infty}\dfrac{\lambda^k}{k!}f^{k}(t)\\ & = e^{-\lambda}e^{\lambda f(t)} \\ & = e^{(f(t)-1)\lambda} \end{align} where $\lambda$ is the parameter of Poisson distribution