Tutorials › Statistical Theory I - Probability and Distribution Theory › Means and Variances of Random Sums

Mixtures, Compounding, and Truncation · Tutorial 656 of 994

Means and Variances of Random Sums

Learn how variation in both the count and the summands determines the mean and variance of a random sum, and how to calculate them in concrete models.

Advanced 9 min read

What You'll Learn

  • Define a random sum when the count may be zero.
  • Derive its expectation using independence and the tail-sum identity for a count.
  • Derive its variance by conditioning on the count.
  • Identify the separate contributions of count variability and summand variability.
  • Calculate random-sum moments for binomial, geometric, and finite-support count distributions.

Why Random Sums Need Two Sources of Variation

A total formed from a random number of contributions varies for two reasons: the contributions themselves may vary, and the number of contributions may vary. Examples include a total claim amount from a random number of claims or the total amount of a randomly sized group of measurements. A useful moment calculation must account for both sources.

Let \(N\) be a nonnegative integer-valued random variable, and let \(X_1,X_2,\ldots\) be independent and identically distributed random variables, independent of \(N\). The sum is defined to be zero when \(N=0\). The key formulas express its mean in terms of the mean count and the mean contribution, and its variance in terms of both the summand variance and count variance.

Definition: The random sum of \(N\) independent, identically distributed summands is $$ S_N=\sum_{i=1}^{N}X_i, $$ with \(S_N=0\) when \(N=0\). Write \(\mu=E[X_1]\) and \(\sigma^2=\operatorname{Var}(X_1)\) when these moments exist. The count \(N\) is assumed independent of the entire sequence \(X_1,X_2,\ldots\).

Independence of the count and summands is essential. It means, for example, that learning the realized count does not change the distribution of any summand. The separate topic of dependent counts and summands requires different formulas.

The Mean of a Random Sum

For the mean, it is enough to assume \(E[N]<\infty\) and \(E[|X_1|]<\infty\). These conditions ensure the total has a finite absolute first moment. The result does not require the summands to be nonnegative.

Theorem (Mean of a random sum): If \(N\) is a nonnegative integer-valued random variable independent of an iid sequence \(X_1,X_2,\ldots\), and \(E[N]<\infty\), \(E[|X_1|]<\infty\), then $$ E[S_N]=E[N]E[X_1]. $$

To prove the formula, represent the random sum as an infinite series whose \(i\)th term is included precisely when \(N\ge i\):

$$ S_N=\sum_{i=1}^{\infty}X_i\mathbf{1}_{\{N\ge i\}}. $$

Here \(\mathbf{1}_{\{N\ge i\}}\) is one if \(N\ge i\) and zero otherwise. The sum is finite almost surely because \(N\) is integer-valued with finite expectation. Moreover, by the monotone convergence theorem and independence,

$$ E\left[\sum_{i=1}^{\infty}|X_i|\mathbf{1}_{\{N\ge i\}}\right] =\sum_{i=1}^{\infty}E[|X_i|]P(N\ge i) =E[|X_1|]\sum_{i=1}^{\infty}P(N\ge i). $$

For a nonnegative integer-valued \(N\), \(N=\sum_{i=1}^{\infty}\mathbf{1}_{\{N\ge i\}}\), so another application of monotone convergence gives \(\sum_{i=1}^{\infty}P(N\ge i)=E[N]\). The displayed absolute expectation is therefore finite. We may consequently interchange expectation and the series, giving

$$ E[S_N] =\sum_{i=1}^{\infty}E[X_i\mathbf{1}_{\{N\ge i\}}] =E[X_1]\sum_{i=1}^{\infty}P(N\ge i) =E[X_1]E[N]. $$

The middle equality uses independence between \(X_i\) and \(N\). This establishes the mean formula. \(\square\)

The Variance of a Random Sum

A variance calculation needs finite second moments for both the count and the summands. Conditional on \(N=k\), the sum contains exactly \(k\) iid terms, so its conditional mean and variance are \(k\mu\) and \(k\sigma^2\), respectively. Averaging the conditional variance captures summand-to-summand variation; the variance of the conditional mean captures variation in the count.

Theorem (Variance of a random sum): Under the same independence and identical-distribution assumptions, suppose \(E[N^2]<\infty\) and \(E[X_1^2]<\infty\). Then $$ E[S_N]=E[N]\mu,\qquad \operatorname{Var}(S_N)=E[N]\sigma^2+\operatorname{Var}(N)\mu^2. $$

For a complete derivation, condition on \(N\). Given \(N=k\), independence of the summands gives

$$ E[S_N\mid N=k]=k\mu,\qquad \operatorname{Var}(S_N\mid N=k)=k\sigma^2. $$

Thus \(E[S_N\mid N]=N\mu\) and \(\operatorname{Var}(S_N\mid N)=N\sigma^2\). The assumed second moments make \(S_N\) square-integrable: conditionally, \(E[S_N^2\mid N]=N\sigma^2+N^2\mu^2\), whose expectation is finite. The law of total variance therefore applies:

$$ \begin{aligned} \operatorname{Var}(S_N) &=E[\operatorname{Var}(S_N\mid N)] +\operatorname{Var}(E[S_N\mid N])\\ &=E[N\sigma^2]+\operatorname{Var}(N\mu)\\ &=E[N]\sigma^2+\operatorname{Var}(N)\mu^2. \end{aligned} $$

The conditional mean also gives \(E[S_N]=E[N\mu]=E[N]\mu\), in agreement with the mean result. This proves both formulas under the stated assumptions. \(\square\)

The variance has a direct interpretation:

1
Variation among contributions.
\(E[N]\sigma^2\) is the expected number of summands multiplied by the variance of one summand.
2
Variation in the count.
\(\operatorname{Var}(N)\mu^2\) is the count variance multiplied by the squared mean contribution.

An equivalent expression, useful when a distribution is described by raw moments, follows by substituting \(\sigma^2=E[X_1^2]-\mu^2\):

$$ \operatorname{Var}(S_N) =E[N]E[X_1^2]+\bigl(\operatorname{Var}(N)-E[N]\bigr)\mu^2. $$

The two terms in the main variance formula are nonnegative. If the summands have mean zero, variation in the count adds no variance term. If the summands are constant, their own variance is zero, but count variation can still make the total variable.

Worked Calculations

Worked Example: Binomial Count and Exponential Contributions

Suppose \(N\sim\operatorname{Binomial}(8,0.2)\), and independently \(X_i\sim\operatorname{Exponential}(2)\), where 2 is the rate. Find the mean and variance of \(S_N\).

For the count, \(E[N]=8(0.2)=1.6\) and \(\operatorname{Var}(N)=8(0.2)(0.8)=1.28\). An exponential distribution with rate 2 has \(\mu=1/2\) and \(\sigma^2=1/2^2=1/4\). The random-sum mean is

$$ E[S_N]=1.6\left(\frac12\right)=0.8. $$

Its variance is

$$ \operatorname{Var}(S_N) =1.6\left(\frac14\right)+1.28\left(\frac12\right)^2 =0.4+0.32 =0.72. $$

Both sources contribute: \(0.4\) comes from the exponential contributions, and \(0.32\) comes from variation in the binomial count.

Worked Example: Geometric Count and Gamma Contributions

Let \(P(N=k)=(1-q)q^k\) for \(k=0,1,\ldots\), with \(q=0.25\). Independently, let each \(X_i\) have a Gamma distribution with shape 2 and scale 3. Find the mean and variance of the total.

For this geometric count, \(E[N]=q/(1-q)\) and \(\operatorname{Var}(N)=q/(1-q)^2\). Substitution gives

$$ E[N]=\frac{0.25}{0.75}=\frac13,\qquad \operatorname{Var}(N)=\frac{0.25}{0.75^2}=\frac49. $$

A Gamma distribution with shape 2 and scale 3 has mean \(2(3)=6\) and variance \(2(3^2)=18\). Hence

$$ E[S_N]=\frac13(6)=2, \qquad \operatorname{Var}(S_N) =\frac13(18)+\frac49(6^2) =6+16 =22. $$

The variance exceeds the contribution-variation term \(6\) because the random count adds \(16\).

Worked Example: A Finite-Support Count and Bernoulli Contributions

Suppose \(P(N=0)=0.2\), \(P(N=1)=0.5\), and \(P(N=3)=0.3\). Independently, let \(X_i\sim\operatorname{Bernoulli}(0.4)\). Calculate the mean and variance of \(S_N\).

First find the count moments directly:

$$ E[N]=0(0.2)+1(0.5)+3(0.3)=1.4, $$ $$ E[N^2]=0^2(0.2)+1^2(0.5)+3^2(0.3)=3.2, \qquad \operatorname{Var}(N)=3.2-(1.4)^2=1.24. $$

A Bernoulli\((0.4)\) variable has \(\mu=0.4\) and \(\sigma^2=0.4(0.6)=0.24\). Therefore

$$ E[S_N]=1.4(0.4)=0.56, $$ $$ \operatorname{Var}(S_N) =1.4(0.24)+1.24(0.4)^2 =0.336+0.1984 =0.5344. $$

As a check, \(E[S_N^2\mid N]=N(0.24)+N^2(0.4)^2\), so \(E[S_N^2]=1.4(0.24)+3.2(0.16)=0.848\). Subtracting the squared mean gives \(0.848-(0.56)^2=0.5344\), as required.

A Common Mistake and Why the Formula Matters

A frequent error is to write \(\operatorname{Var}(S_N)=E[N]\sigma^2\) and stop there. That calculation treats the number of contributions as though it were fixed at its average. The omitted term, \(\operatorname{Var}(N)\mu^2\), accounts for variation in the count. For example, if every contribution equals a constant \(c\), then \(S_N=cN\), so its variance must be \(c^2\operatorname{Var}(N)\). The full formula gives exactly that result because \(\sigma^2=0\) and \(\mu=c\).

At the other extreme, when \(\mu=0\), the count-variation term vanishes. This does not mean the count is irrelevant: \(E[N]\sigma^2\) still depends on the average number of contributions. These checks help diagnose whether a calculation has included the right sources of variation.

The formulas are useful whenever a total combines a random count with repeated contributions. They reduce a potentially complicated distributional calculation to four quantities: \(E[N]\), \(\operatorname{Var}(N)\), \(E[X_1]\), and \(\operatorname{Var}(X_1)\). For the moment calculations here, it is not necessary to find the full distribution of \(S_N\).

Key takeaway: For an independent count and iid summands with the required finite moments, \(E[S_N]=E[N]E[X_1]\), while \(\operatorname{Var}(S_N)=E[N]\operatorname{Var}(X_1)+\operatorname{Var}(N)(E[X_1])^2\). The variance has one contribution from the summands and another from the count.

Check Your Understanding

Use the independence assumptions and moment formulas carefully.

  1. State the conditions under which the mean formula for \(S_N\) holds, including the integrability condition on \(X_1\).
  2. If \(N\) is constant and equal to \(m\), simplify the variance formula and explain why the count-variation term disappears.
  3. Suppose \(E[N]=3\), \(\operatorname{Var}(N)=2\), \(E[X_1]=5\), and \(\operatorname{Var}(X_1)=4\). Find \(E[S_N]\) and \(\operatorname{Var}(S_N)\).
  4. If \(X_i=c\) with probability one, express \(S_N\) in terms of \(N\) and verify its variance using the random-sum formula.
  5. Explain why the formula \(E[N]\operatorname{Var}(X_1)\) alone does not generally equal \(\operatorname{Var}(S_N)\).