Variance of a Product of Random Variables: Independent & Dependent
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
This calculator finds the variance of the product of two random variables, given their means, variances, and covariance. You enter the mean and variance of X, the mean and variance of Y, and (if the variables are dependent) their covariance; the calculator returns the variance of XY using the exact formula for the dependent case, which also covers the independent case when covariance is zero.
Formula
The variance of a product of two random variables is not simply the product of their variances. The general formula, which holds for both independent and dependent variables, is:
Var(XY) = Var(X)Var(Y) + Var(X)[E(Y)]² + Var(Y)[E(X)]² + 2E(X)E(Y)Cov(X,Y) + [Cov(X,Y)]²
Where:
- E(X) and E(Y) are the means (expected values) of X and Y.
- Var(X) and Var(Y) are the variances of X and Y.
- Cov(X,Y) is the covariance between X and Y. For independent variables, Cov(X,Y) = 0.
This formula is exact for any distributions, provided the means and variances exist. It is derived from the definition of variance: Var(Z) = E(Z²) − [E(Z)]², with Z = XY.
Worked Example
Using the default values: E(X)=2, Var(X)=1, E(Y)=3, Var(Y)=2, and Cov(X,Y)=0 (independent case).
- Compute the square of each mean: (E(X))² = 4, (E(Y))² = 9.
- Multiply: Var(X)Var(Y) = 1 × 2 = 2.
- Var(X)[E(Y)]² = 1 × 9 = 9.
- Var(Y)[E(X)]² = 2 × 4 = 8.
- Since Cov=0, the last two terms vanish.
- Sum: 2 + 9 + 8 = 19.
The calculator gives Var(XY) = 19.0000, matching the manual calculation.
Independent vs. Dependent Cases
When X and Y are independent, the covariance is zero, so the formula simplifies to:
Var(XY) = Var(X)Var(Y) + Var(X)[E(Y)]² + Var(Y)[E(X)]²
This is the most commonly quoted version. For dependent variables, you must include the covariance terms. The full formula shows that even zero means do not make the variance zero unless both variances are zero. For example, if X takes values −1 and 1 with equal probability and Y takes 2 and 4 with equal probability, independent, then E(X)=0, Var(X)=1, E(Y)=3, Var(Y)=1. The simplified formula gives Var(XY)=1×1 + 1×9 + 1×0 = 10, which is correct.
When to Use This Formula
This is used in many fields where products of random quantities appear:
- Finance: portfolio returns are products of prices and quantities.
- Engineering: power = voltage × current, each with uncertainty.
- Physics: momentum = mass × velocity.
- Signal processing: product of two random signals.
In all these cases, you need the variance of the product to quantify uncertainty in the result.
Common Mistakes and Misconceptions
- Assuming Var(XY) = Var(X)Var(Y) – this only holds when both means are zero and variables are independent.
- Forgetting the mean terms – even with independent variables, the terms with squared means are often the largest contributors.
- Ignoring covariance – if the variables are correlated, omitting covariance can severely underestimate or overestimate the variance.
- Using standard deviations instead of variances – the formula requires variances, not standard deviations.
Limitations and Extensions
The formula assumes the means and variances exist (i.e., are finite). For heavy-tailed distributions, these may not exist. Also, the formula is exact only for the product of two variables. For more than two, the formula becomes more complex and involves higher moments. In practice, if the variables are approximately normal, the product is often approximated by a normal distribution, but this is not always accurate.
Frequently Asked Questions
What if my variables are independent but I don’t know the covariance?
If they are truly independent, the covariance is zero by definition. You can set it to 0 in the calculator. If you are unsure, you can estimate covariance from data using the formula: Cov(X,Y) = E[(X−E(X))(Y−E(Y))].
Can I use this for discrete variables?
Yes, the formula works for both discrete and continuous random variables, as long as the means and variances exist. The derivation uses only the definition of variance and expectation.
What if one of the variables has a mean of zero?
Then the terms with that mean vanish. For example, if E(X)=0, the formula becomes Var(XY) = Var(X)Var(Y) + Var(X)[E(Y)]² + Cov(X,Y)². Even with zero mean, the variance is not simply the product of variances.
How do I find the covariance if I only have correlation?
Cov(X,Y) = �(X,Y) × σ(X) × σ(Y), where � is the correlation coefficient and σ is the standard deviation. You can compute this and then enter the covariance.
Is this the same as the variance of the sum of products?
No. The variance of a sum of products (e.g., portfolio of multiple assets) requires additional terms involving covariances between different products. The formula here is for a single product XY.
Why does the formula include a covariance squared term?
That term comes from the expansion of E[(XY)²] when X and Y are dependent. It accounts for the variance contributed by the joint variability beyond the individual variances.
Related
Formula used
in mx | Mean of X | - | 2 | 0 in vx | Variance of X | - | 1 | 0 in my | Mean of Y | - | 3 | 0 in vy | Variance of Y | - | 2 | 0 in cxy | Covariance(X,Y) | - | 0 | 0 out varXY | Variance of XY | - | vx*vy + vx*my^2 + vy*mx^2 + 2*mx*my*cxy + cxy^2 | 4 out sdXY | Std. Dev. of XY | - | sqrt(varXY) | 4
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.