Variance & Moments

Two funds both return 6\% a year on average. One creeps up in a nearly straight line; the other lurches — up 40\% one year, down 25\% the next. Their expectations are identical, so the mean literally cannot tell them apart. Yet no investor on Earth is indifferent between them.

The mean says where a distribution lives; it says nothing about how much it wobbles. And in finance, wobble is risk — it is measured, priced, hedged and paid for in actual dollars. A volatile asset must offer extra expected return to get bought at all (the "risk premium"); an option's entire price is a bet on wobble; a bank's regulatory capital is set by it. The mathematics of wobble is the variance, and beyond it a whole ladder of moments — the third and fourth of which describe the shape of disaster: how lopsided the losses are, and how fat the tails.

The n-th moment of a random variable is simply the expectation of its n-th power:

\mathbb{E}[X^{n}] \;=\; \int_{\Omega} X^{n}\, d\mathbb{P}.

The first moment is the mean \mu = \mathbb{E}[X]; the second moment \mathbb{E}[X^{2}] feeds the spread; the third and fourth capture asymmetry and tail-weight. Each moment recovers one more shred of information about the distribution that the ones before it cannot see. This page climbs that ladder.

Variance: the spread around the mean

The variance is the expected squared distance from the mean — the average of how far X lands from its own centre, squared so that overshoots and undershoots both count:

\operatorname{Var}(X) \;=\; \mathbb{E}\big[(X - \mu)^{2}\big].

This is the honest definition, but the squared deviation is awkward to compute. Expanding the square turns it into something far friendlier — keep \mu = \mathbb{E}[X] in mind as a constant throughout. Start from the definition and multiply out (X - \mu)^2:

\operatorname{Var}(X) \;=\; \mathbb{E}\big[(X - \mu)^{2}\big] \;=\; \mathbb{E}\big[X^{2} - 2\mu X + \mu^{2}\big].

Now use linearity of expectation to split the expectation over the three terms:

=\; \mathbb{E}[X^{2}] - \mathbb{E}[2\mu X] + \mathbb{E}[\mu^{2}].

Pull the constants 2\mu and \mu^2 out of their expectations (and note \mathbb{E}[\mu^2] = \mu^2, the expectation of a constant is itself):

=\; \mathbb{E}[X^{2}] - 2\mu\,\mathbb{E}[X] + \mu^{2}.

Finally substitute \mathbb{E}[X] = \mu, so the middle term is 2\mu\cdot\mu = 2\mu^2, and collect:

=\; \mathbb{E}[X^{2}] - 2\mu^{2} + \mu^{2} \;=\; \mathbb{E}[X^{2}] - \mu^{2}.

That is the formula you will reach for every time: \operatorname{Var}(X) = \mathbb{E}[X^{2}] - \mu^{2} — "the mean of the square minus the square of the mean". Read it once more with fresh eyes: it says \mathbb{E}[X^2] and (\mathbb{E}[X])^2 are different numbers, and their gap is precisely the variance. They coincide only when the variance is zero — that is, when X is a constant and nothing is random at all.

Because variance is in squared units, we usually quote its square root, the standard deviation \sigma = \sqrt{\operatorname{Var}(X)}, which lives in the same units as X itself. In finance the standard deviation of a return has its own name — volatility — and it is the single most quoted risk number in the industry.

Worked example: both formulas, same answer

A stock's one-year return X (in percent) is +10 with probability 0.6 and -5 with probability 0.4. First the mean:

\mu \;=\; \mathbb{E}[X] \;=\; 10 \cdot 0.6 + (-5) \cdot 0.4 \;=\; 6 - 2 \;=\; 4.

Route 1 — the definition. Average the squared deviations from \mu = 4:

\operatorname{Var}(X) \;=\; (10-4)^2 \cdot 0.6 + (-5-4)^2 \cdot 0.4 \;=\; 36 \cdot 0.6 + 81 \cdot 0.4 \;=\; 21.6 + 32.4 \;=\; 54.

Route 2 — the computational formula. Get the second moment first, averaging the squares of the raw values:

\mathbb{E}[X^{2}] \;=\; 10^2 \cdot 0.6 + (-5)^2 \cdot 0.4 \;=\; 60 + 10 \;=\; 70, \operatorname{Var}(X) \;=\; \mathbb{E}[X^{2}] - \mu^{2} \;=\; 70 - 16 \;=\; 54.

Both routes land on 54, as they must — they are the same quantity, expanded two ways. The volatility is \sigma = \sqrt{54} \approx 7.3 percentage points: a typical year lands roughly 7 points either side of the 4\% mean. Notice how the rarer outcome (-5, probability 0.4) contributes more to the variance than the likelier one: it sits 9 points from the mean, and squaring punishes distance mercilessly. Variance always over-weights the far-flung outcomes — which is exactly what a risk measure should do.

For the cleanest possible case, take a fair coin scaled to \{0, 4\}: the mean is 2, the second moment is 0^2\cdot\tfrac12 + 4^2\cdot\tfrac12 = 8, so \operatorname{Var}(X) = 8 - 4 = 4 and \sigma = 2. The variable sits exactly 2 units either side of its mean — which is perfect, since it only ever is 0 or 4. (In general a 50–50 gamble on \mu \pm d has variance exactly d^2 — worth memorising, and worth re-deriving once from either route.)

How it scales — why leverage squares risk

Shifting a random variable leaves its spread untouched, and stretching it scales the spread by the square of the stretch. Here is the derivation with every step shown. Let Y = aX + b. First find its mean by linearity:

\mathbb{E}[Y] \;=\; \mathbb{E}[aX + b] \;=\; a\,\mathbb{E}[X] + b \;=\; a\mu + b.

Now form the centred deviation Y - \mathbb{E}[Y] — and watch the shift b cancel:

Y - \mathbb{E}[Y] \;=\; (aX + b) - (a\mu + b) \;=\; aX - a\mu \;=\; a\,(X - \mu).

The +b moved the variable and its mean by the same amount, so it leaves the deviation alone. Put this centred deviation into the definition of variance:

\operatorname{Var}(aX + b) \;=\; \mathbb{E}\big[(Y - \mathbb{E}[Y])^{2}\big] \;=\; \mathbb{E}\big[\big(a(X - \mu)\big)^{2}\big].

Expand the square, separating the constant factor:

=\; \mathbb{E}\big[a^{2}\,(X - \mu)^{2}\big].

Pull the constant a^{2} out of the expectation by linearity, and recognise what remains as \operatorname{Var}(X):

=\; a^{2}\,\mathbb{E}\big[(X - \mu)^{2}\big] \;=\; a^{2}\,\operatorname{Var}(X).

So b drops out (a shift cannot change spread) and a comes out squared (stretching distances by a stretches squared distances by a^2).

Both halves of this identity are daily facts of financial life. The a^2 is leverage. Borrow money to double your position (a = 2) and your expected gain doubles — but your variance quadruples. A 3\times leveraged ETF carries 9\times the variance of its index (three times the volatility). Return scales linearly with leverage; risk, measured as variance, scales quadratically — which is why leverage feels fine right up until it doesn't. The vanishing b is cash. Adding a fixed, riskless amount — a guaranteed coupon, a salary, interest on cash — shifts the whole distribution without changing its shape at all. Sure money moves the mean and touches the variance not one bit.

Variance of a sum: where correlation sneaks in

Portfolios are sums, so the variance of a sum is the question finance asks most. Centre each variable (write \tilde X = X - \mu_X, \tilde Y = Y - \mu_Y) and expand the square:

\operatorname{Var}(X + Y) \;=\; \mathbb{E}\big[(\tilde X + \tilde Y)^2\big] \;=\; \mathbb{E}[\tilde X^2] + 2\,\mathbb{E}[\tilde X \tilde Y] + \mathbb{E}[\tilde Y^2].

The two outer terms are the individual variances. The middle term is new — it is the covariance, \operatorname{Cov}(X, Y) = \mathbb{E}[(X-\mu_X)(Y-\mu_Y)], which is positive when the two variables tend to miss their means on the same side and negative when they tend to miss on opposite sides. So:

\operatorname{Var}(X + Y) \;=\; \operatorname{Var}(X) + \operatorname{Var}(Y) + 2\operatorname{Cov}(X, Y).

Only when the covariance is zero — in particular whenever X and Y are independent — do variances simply add. Cross-terms never appear in the mean of a sum (linearity holds unconditionally); they always threaten the variance of a sum. That middle term is where all of portfolio theory lives.

A tiny portfolio. Two stocks each have volatility \sigma = 2\%, so \operatorname{Var} = 4 each. Split your money half-and-half: the portfolio return is P = \tfrac12 X + \tfrac12 Y, and by the scaling rule each half contributes \tfrac14 \cdot 4 = 1.

\text{Independent: } \operatorname{Var}(P) = 1 + 1 = 2, \quad \sigma_P = \sqrt{2} \approx 1.41\%.

Diversification for free: same expected return, risk down from 2\% to 1.41\%, purely because the wobbles partly cancel. Now let the stocks move in lockstep — \operatorname{Cov}(X, Y) = 4, perfect correlation:

\text{Correlated: } \operatorname{Var}(P) = 1 + 1 + 2 \cdot \tfrac12 \cdot \tfrac12 \cdot 4 = 4, \quad \sigma_P = 2\%.

The diversification benefit evaporates entirely: holding two clones is the same as holding one. The whole difference between the two worlds is the covariance term — which is why "what is the correlation?" is the first question any risk manager asks, and why assets that stay uncorrelated in a crash (when everything else suddenly correlates) are the most precious things in finance.

For random variables X, Y with finite second moments, mean \mu = \mathbb{E}[X], and any constants a, b:

The first two follow from linearity of expectation alone — no independence, no distributional assumptions.

The third moment: which way disaster leans

Variance is blind to direction: it squares every deviation, so a +9 surprise and a -9 surprise count identically. But an investor cares enormously which side the big surprises land on. The standardised third central moment, the skewness

\gamma_1 \;=\; \mathbb{E}\!\left[\left(\frac{X - \mu}{\sigma}\right)^{\!3}\right],

keeps the sign: cubing preserves direction, so a long right tail (rare huge gains — a lottery ticket) gives positive skewness, and a long left tail (rare huge losses) gives negative skewness.

Worked sign. Consider a strategy that behaves like selling insurance: it earns \$1 with probability 0.99 and loses \$99 with probability 0.01. Its mean is

\mu \;=\; 1 \cdot 0.99 + (-99) \cdot 0.01 \;=\; 0.99 - 0.99 \;=\; 0,

a perfectly fair game. Its variance (mean zero, so just the second moment) is

\operatorname{Var}(X) \;=\; 1^2 \cdot 0.99 + (-99)^2 \cdot 0.01 \;=\; 0.99 + 98.01 \;=\; 99,

and its third moment is dominated by the cube of the loss:

\mathbb{E}[X^{3}] \;=\; 1 \cdot 0.99 + (-99)^3 \cdot 0.01 \;=\; 0.99 - 9702.99 \;=\; -9702, \gamma_1 \;=\; \frac{-9702}{99^{3/2}} \;\approx\; -9.85.

A skewness near -10 is violently negative. The strategy wins 99 days out of 100 — a beautiful, smooth track record — and then one bad day erases everything. Traders call this "picking up pennies in front of a steamroller". Mean zero, variance 99: neither number sees the asymmetry. The third moment is the first one that does, which is why quants inspect skewness before believing any suspiciously steady return stream.

In August 2007 the CFO of Goldman Sachs explained a quant fund's losses to the press: "We were seeing things that were 25-standard-deviation moves, several days in a row." Take the sentence at face value under a Gaussian model and it is not an excuse — it is a confession. For a normal distribution, a single 25\sigma event has probability of order 10^{-137}: you would not expect one in the lifetime of billions of universes, let alone several in a week. The moves happened; therefore the model's tails were wrong, not the world.

The moment that measures tail-weight is the fourth: the kurtosis \mathbb{E}[Z^4] (with Z = (X-\mu)/\sigma). The fourth power hardly notices ordinary deviations but amplifies extreme ones enormously, so kurtosis is essentially a census of the tails. Every Gaussian, whatever its \mu and \sigma, has kurtosis exactly 3; real daily equity returns clock in far higher — fat tails. Same mean, same variance, vastly more monsters. Two distributions can agree on their first two moments and disagree completely about how often catastrophe strikes; the fourth moment is where that disagreement shows up first.

And yet the second moment alone built an empire. In 1952 Harry Markowitz proposed judging a portfolio by exactly two numbers — the mean and the variance of its return — and noticed that the covariance identity \operatorname{Var}(X+Y) = \operatorname{Var}(X) + \operatorname{Var}(Y) + 2\operatorname{Cov}(X,Y) makes diversification a theorem rather than a proverb. That one identity became modern portfolio theory and won the 1990 Nobel Prize in economics. The moments ladder in one line of finance history: Markowitz made a science of the second moment; 2007 was a reminder that the third and fourth were still waiting.

Seeing the spread

Both bells below are centred on the same mean \mu = 0 — think of the horizontal axis as an asset's return, so the two curves are our two funds from the top of the page: identical expectations, different wobble. The faint curve is fixed at \sigma = 1; the bold one tracks the slider. Push \sigma up and the bold bell flattens and widens — its area stays 1 (total probability is conserved), so spreading it out must lower its peak. Probability drains from the centre into the flanks: ordinary days become less predictable and big moves, both good and bad, become more common. Variance is exactly this width made precise — and the slider is the a in \operatorname{Var}(aX) = a^2 \operatorname{Var}(X): doubling \sigma is what 2\times leverage does to the shape of your returns.

Standardisation. Every random variable can be re-zeroed and re-scaled to a common footing. Define Z = \dfrac{X - \mu}{\sigma}. Its mean vanishes by linearity,

\mathbb{E}[Z] \;=\; \frac{1}{\sigma}\big(\mathbb{E}[X] - \mu\big) \;=\; \frac{1}{\sigma}(\mu - \mu) \;=\; 0,

and its variance is 1 by the scaling rule with a = \tfrac{1}{\sigma} and b = -\tfrac{\mu}{\sigma}:

\operatorname{Var}(Z) \;=\; \Big(\tfrac{1}{\sigma}\Big)^{2}\operatorname{Var}(X) \;=\; \frac{1}{\sigma^{2}}\cdot \sigma^{2} \;=\; 1.

So Z measures "how many standard deviations from the mean" — the universal yardstick behind z-scores, the standard normal, and every "k-sigma event" headline.

Higher moments. Variance is the second central moment \mathbb{E}[(X-\mu)^2]; the standardised central moments keep describing the shape. The third, skewness \mathbb{E}[Z^3], measures lopsidedness — positive means a long right tail; the fourth, kurtosis \mathbb{E}[Z^4], measures how heavy the tails are relative to a bell, the difference between calm markets and ones prone to extreme jumps. Each higher moment adds one more shred of shape information the mean and variance cannot see.

Why square, not take absolute values? One could measure spread by the mean-absolute-deviation \mathbb{E}[\,|X - \mu|\,], but squaring wins for a deep reason: it makes spread a Pythagorean quantity. Centred random variables live in the space L^2 with inner product \langle X, Y\rangle = \mathbb{E}[XY], and the variance is a squared length, \operatorname{Var}(X) = \|X - \mu\|^2. Uncorrelated variables are then orthogonal, and variances add by the Pythagorean theorem exactly as perpendicular sides do — \operatorname{Var}(X + Y) = \operatorname{Var}(X) + \operatorname{Var}(Y). The absolute value has no such geometry; it is the L^2 structure that gives variance, regression, and the whole machinery of least squares their right angles.