Why a Weighted Sum Needs Pairwise Covariances
When a total is formed from several random quantities, its uncertainty depends not only on how variable each quantity is, but also on how they vary together. For example, a portfolio total might combine several hypothetical loss amounts, with different weights applied to each. Adding the individual variances alone generally does not give the total variance: the relationships between distinct amounts also matter.
The two-variable case is a useful starting point, but a sum of \(n\) variables requires accounting for every distinct pair. The main task is to include each pair exactly once and apply the correct coefficient and factor of two.
For each distinct pair \(X_i,X_j\), the covariance is \(\operatorname{Cov}(X_i,X_j)=E[(X_i-E[X_i])(X_j-E[X_j])]\). A negative covariance contributes a negative term when the product of the weights is positive; the signs of both weights and the covariance must be considered together.
The General Formula
The first sum contains \(n\) individual variance terms. The second sum contains \(n(n-1)/2\) distinct pairs. For three variables, the three pairs are \((1,2)\), \((1,3)\), and \((2,3)\); for four variables, there are six pairs. A zero weight removes every term involving that variable, while a negative weight changes the signs of its terms according to the formula.
Why the Formula Holds
The derivation uses the definition of variance and the distributive law. Since the weights are fixed, centering the weighted sum centers each variable separately:
Square this expression. Each squared term contributes a variance, and each product of two different centered variables contributes a covariance. Because \(X_i-E[X_i]\) and \(X_j-E[X_j]\) are ordinary scalar random variables, the cross-product for the pair \((i,j)\) occurs in both orders and the two products are equal.
This proof also shows the limits of the result. The weights must be fixed constants for this expansion to have the stated form; random weights need separate treatment. Finite second moments are needed for the variances and covariances in the formula to be finite. No distributional assumption, such as normality, is needed.
Worked Example: Three Variables with Mixed Signs
Suppose \(X_1,X_2,X_3\) have means \(4,3,1\), variances \(5,2,3\), and covariances \(\operatorname{Cov}(X_1,X_2)=1\), \(\operatorname{Cov}(X_1,X_3)=-0.5\), and \(\operatorname{Cov}(X_2,X_3)=0.25\). Let \(T=X_1-X_2+2X_3\). Find \(E[T]\) and \(\operatorname{Var}(T)\). Assume a joint distribution with these finite moments; no particular distribution is specified. There is no interest, discounting, or mortality assumption in this statistical model.
Method. Use linearity of expectation for the mean, then apply the weighted-sum variance formula with weights \(w_1=1\), \(w_2=-1\), and \(w_3=2\).
First calculate the mean:
The individual variance terms are:
Next calculate the three pair contributions inside the covariance sum:
These terms sum to \(-2.5\), so their total contribution after multiplying by \(2\) is \(-5\). Therefore,
Check. The negative covariance contribution reduces the individual-term total from \(19\) to \(14\), which is nonnegative as a variance must be. A common mistake here is to treat the negative weight on \(X_2\) as if it changed only the variance term. It also changes the sign of each pair term involving \(X_2\), as the products \(w_iw_j\) show.
Organizing Many Pair Terms
For a larger sum, a reliable approach is to make a list of all distinct pairs before substituting numbers. With four variables, there are six pairs; do not include both \((i,j)\) and \((j,i)\) in the pair list, because the formula already has a factor of \(2\). If a covariance is not supplied, do not silently set it to zero: use zero only when it is given or established from the model.
Worked Example: Four Variables and Six Possible Pairs
Let \(X_1,X_2,X_3,X_4\) have finite second moments and unspecified joint distribution. Suppose their variances are \(2,5,3,4\). The nonzero covariances are \(\operatorname{Cov}(X_1,X_2)=0.5\), \(\operatorname{Cov}(X_1,X_4)=-1\), \(\operatorname{Cov}(X_2,X_3)=0.25\), and \(\operatorname{Cov}(X_3,X_4)=1\); the other two pair covariances are zero. For \(T=X_1+2X_2-X_3+0.5X_4\), find the variance. No interest or mortality assumptions apply; this is a model specified by its moments, not by a named distribution.
Method. Use weights \(1,2,-1,0.5\). First sum the four individual terms:
Now list all six pairs so none are missed:
The pair products sum to \(1+0-0.5-0.5+0-0.5=-0.5\). The covariance contribution is twice that sum, or \(-1\). Thus,
Check. The result is positive, and all six pairs have been accounted for. A common mistake is to add the pair products only once, obtaining \(26-0.5=25.5\). The formula requires \(2\) times their sum, so the correct variance is \(25\).
Application to a Hypothetical Portfolio
A portfolio total is one practical setting for a weighted sum. The weights can represent the number of units or the amount of exposure assigned to each component. If each \(X_i\) is measured in thousands of dollars, the variance of the total is measured in squared thousands of dollars. The square root of that variance, if needed, returns to the original monetary units.
The example below is hypothetical. It specifies the relevant moments directly; the distribution of each loss is not specified. There is no discounting, interest rate, or mortality assumption in the calculation.
Worked Example: Variance of a Weighted Loss Portfolio
A hypothetical portfolio total, in thousands of dollars, is \(L=X_1+0.5X_2+2X_3\). The component means are \(12,8,5\), the variances are \(4,9,1\), and the covariances are \(\operatorname{Cov}(X_1,X_2)=2\), \(\operatorname{Cov}(X_1,X_3)=0.5\), and \(\operatorname{Cov}(X_2,X_3)=1.5\). Assume these moments come from a joint distribution with finite second moments. Find the expected portfolio total and its variance.
Method. First apply linearity of expectation using weights \(1,0.5,2\):
Thus the expected total is \(26\) thousand dollars. The individual variance terms are:
The three pair products are:
Their sum is \(3.5\), and the full covariance contribution is \(2(3.5)=7\). Therefore,
in squared thousands of dollars. As a check in the original scale, the standard deviation is \(\sqrt{17.25}\approx4.153\) thousand dollars, rounded to three decimals; squaring \(4.153\) gives approximately \(17.247\), consistent with \(17.25\) after rounding. The expected total is \(26\) thousand dollars, or \(\$26{,}000\).
Common mistake avoided. The weights apply to the random amounts before variance is taken: each individual variance is multiplied by the squared weight, while each covariance is multiplied by the product of the two weights and then included with the factor \(2\).
Common Errors and a Practical Checklist
The most consequential errors are usually bookkeeping errors rather than difficult algebra. A negative weight affects both the squared individual term and the pair terms, although squaring makes its individual variance contribution nonnegative. A negative covariance does not automatically reduce the total variance: its effect depends on the product \(w_iw_j\). For example, a negative covariance paired with one positive and one negative weight gives a positive pair contribution.
Before finalizing a calculation, check these points:
- Each individual variance is multiplied by the square of its weight.
- Every distinct pair appears once in the pair sum, with its covariance and both weights.
- The entire pair sum is multiplied by \(2\).
- The covariance signs and weight signs are both retained.
- The final result is nonnegative and has squared units.
A negative intermediate covariance contribution is not an error. It means that, for the given weights, the pairwise relationships reduce the variance relative to the sum of individual terms. The final variance, however, cannot be negative for a valid joint model.
Check Your Understanding
For each problem, use the stated moments and fixed weights. Distributional assumptions are not required unless stated; no interest or mortality assumptions apply.
- Let \(T=2X_1-X_2+X_3\), where the variances are \(3,2,5\), \(\operatorname{Cov}(X_1,X_2)=-0.5\), \(\operatorname{Cov}(X_1,X_3)=0.25\), and \(\operatorname{Cov}(X_2,X_3)=1\). Find \(\operatorname{Var}(T)\). (Answer: 20)
- Let \(T=X_1-2X_2+0.5X_3+X_4\). The variances are \(2,1,4,3\); the nonzero covariances are \(\operatorname{Cov}(X_1,X_2)=0.25\), \(\operatorname{Cov}(X_1,X_4)=-0.5\), \(\operatorname{Cov}(X_2,X_3)=0.5\), and \(\operatorname{Cov}(X_3,X_4)=1\). All other pair covariances are zero. Find \(\operatorname{Var}(T)\). (Answer: 8)
- Let \(L=X_1+0.5X_2-X_3\), with means \(6,4,2\), variances \(1,4,9\), and covariances \(\operatorname{Cov}(X_1,X_2)=1\), \(\operatorname{Cov}(X_1,X_3)=-0.5\), and \(\operatorname{Cov}(X_2,X_3)=0.5\). Find both \(E[L]\) and \(\operatorname{Var}(L)\). (Answer: \(E[L]=6\); \(\operatorname{Var}(L)=12.5\))
- For \(T=X_1+2X_2-X_3+0.5X_4\), the variances are \(2,3,1,4\). The only nonzero covariances are \(\operatorname{Cov}(X_1,X_2)=0.5\), \(\operatorname{Cov}(X_1,X_4)=-1\), \(\operatorname{Cov}(X_2,X_3)=0.25\), and \(\operatorname{Cov}(X_3,X_4)=1\). Find \(\operatorname{Var}(T)\). (Answer: 15)
- Let \(T=X_1-X_2+2X_3+0.5X_4-2X_5\). The variances are \(1,2,1,4,1\). The only nonzero covariances are \(\operatorname{Cov}(X_1,X_2)=0.5\), \(\operatorname{Cov}(X_1,X_5)=-0.25\), \(\operatorname{Cov}(X_3,X_4)=0.5\), and \(\operatorname{Cov}(X_4,X_5)=0.5\). Find \(\operatorname{Var}(T)\). (Answer: 12)