I tried to get an expression for the variance of a sum of a random number of iid random variables. My question is whether it is correct and, if not, what is wrong or what additional assumptions might be missing.
Specifically, let:
$$S=\sum_1^N{X_i},$$ where $N$ is a non-negative integer-valued random variable.
Suppose that the distributions of both $N$ and $X$ are known (and $X_i$ are iid), I want to know the value of the variance of $S$.
Is the following solution correct?
$$V(S)=V(X)E(N)+E(X)^2V(N)$$