Probability Theory Fundamentals › Variance and Standard Deviation

Michael BrenndoerferOctober 19, 20255 min read
Quantitative FinanceAll chapters
Part 1 of 15Mathematical Foundations
Chapter 2Probability Theory Fundamentals › Variance and Standard Deviation
Reading section 6 of 15 · Variance and Standard Deviation · 5 minSection 6 of 15 · 5 min

Book contents

Section 6 of 15 · 5 min read

Probability Theory Fundamentals › Variance and Standard DeviationOne section · Sections in this chapter6 / 15 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

While expected value describes the center of a distribution, it tells us nothing about spread. Two investments might have the same expected return but vastly different risk profiles. Consider two stocks, both with 10% expected return. One might reliably return between 8% and 12%, while the other swings between -30% and +50%. Expected value alone cannot distinguish these dramatically different risk profiles. Variance quantifies this dispersion.

Variance

For a random variable XX with a finite second moment, variance is the expected squared deviation from the mean:

Var(X)=E[(X−μ)2]=E[X2]−(E[X])2\text{Var}(X) = E[(X - \mu)^2] = E[X^2] - (E[X])^2

where:

  • Var(X)\text{Var}(X): variance of random variable XX, measuring the spread or dispersion of values around the mean
  • E[⋅]E[\cdot]: expected value operator
  • μ=E[X]\mu = E[X]: mean of XX
  • (X−μ)2(X - \mu)^2: squared deviation from the mean; squaring makes both signs contribute nonnegatively and emphasizes larger deviations
  • E[X2]E[X^2]: expected value of XX squared (the "mean of the square")
  • (E[X])2(E[X])^2: square of the expected value (the "square of the mean")

The standard deviation is σ=Var(X)\sigma = \sqrt{\text{Var}(X)}, which returns the measure to the original units of XX.

Variance squares deviations to remove signs and give larger deviations more weight. This symmetric quadratic penalty is a modeling choice; general risk aversion does not imply that gains and losses of equal size should receive identical quadratic treatment.

The second formula, Var(X)=E[X2]−(E[X])2\text{Var}(X) = E[X^2] - (E[X])^2, is convenient for hand calculations. It says variance equals the "mean of the square minus the square of the mean." We can compute E[X2]E[X^2] and E[X]E[X] separately and then combine them. In floating-point code, subtracting two nearly equal large numbers can lose precision, so a centered calculation is preferable when the mean is large relative to the spread.

To see why these formulas are equivalent, expand the definition:

E[(X−μ)2]=E[X2−2μX+μ2]=E[X2]−2μE[X]+μ2=E[X2]−2μ2+μ2=E[X2]−μ2E[(X - \mu)^2] = E[X^2 - 2\mu X + \mu^2] = E[X^2] - 2\mu E[X] + \mu^2 = E[X^2] - 2\mu^2 + \mu^2 = E[X^2] - \mu^2

Since μ=E[X]\mu = E[X], this gives us E[X2]−(E[X])2E[X^2] - (E[X])^2. The derivation uses linearity of expectation: we can pass the expectation through the sum and pull constants outside, reducing the problem to computing E[X2]E[X^2] and E[X]E[X].

Financial Interpretation

Standard deviation is a standard measure of return volatility, not a complete measure of financial risk. For returns measured over the same horizon and annualized under the same convention, 20% volatility indicates greater standard-deviation spread than 10% volatility. Under normality, roughly 68% of returns fall within one standard deviation of the mean, and 95% fall within two standard deviations. If the one-year simple return is modeled as normal with mean 10% and standard deviation 20%, its probability of falling between -10% and +30% is about two-thirds. Here 20% is the standard deviation of the specified one-year return. The later compounding exercise uses an annualized daily-volatility input, a different quantity.

In[11]:
Code
# Using the binary model from before
# Expected return already calculated
expected_return_squared = np.sum(outcomes**2 * probabilities)
variance = expected_return_squared - expected_return**2
std_dev = np.sqrt(variance)
Out[12]:
Console
E[R] = 8.00%
E[R²] = 0.0280
Var(R) = E[R²] - (E[R])² = 0.0280 - (0.0800)² = 0.0216
Standard deviation = 14.70%

The 14.7% standard deviation indicates substantial uncertainty around the 8% expected return. This volatility measure helps investors understand the range of outcomes they face and calibrate position sizes appropriately. A risk-averse investor might demand higher expected returns from this volatile investment compared to a more stable alternative.

Properties of Variance

Variance has different properties than expected value, which reflects its role in measuring spread rather than center:

Scaling: Var(aX)=a2Var(X)\text{Var}(aX) = a^2 \text{Var}(X). Doubling a position quadruples variance, while standard deviation scales by ∣a∣|a| and expected-return exposure scales by aa. The quadratic statement applies to variance specifically, not to every risk measure.

Sum of independent variables: If XX and YY are independent with finite variances:

Var(X+Y)=Var(X)+Var(Y)\text{Var}(X + Y) = \text{Var}(X) + \text{Var}(Y)

This result follows from independence: when XX and YY are independent, their covariance is zero, eliminating the cross term that would otherwise appear. Independence means knowing the value of one variable provides no information about the other, so their variances add without reinforcement or cancellation.

Sum of dependent variables: For XX and YY with finite variances:

Var(X+Y)=Var(X)+Var(Y)+2Cov(X,Y)\text{Var}(X + Y) = \text{Var}(X) + \text{Var}(Y) + 2\text{Cov}(X, Y)

where:

  • Var(X+Y)\text{Var}(X + Y): variance of the sum of XX and YY
  • Var(X)\text{Var}(X), Var(Y)\text{Var}(Y): individual variances
  • Cov(X,Y)\text{Cov}(X, Y): covariance between XX and YY
  • The factor of 2 arises because when expanding (X+Y−μX+Y)2=((X−μX)+(Y−μY))2(X + Y - \mu_{X+Y})^2 = ((X - \mu_X) + (Y - \mu_Y))^2, the cross term 2(X−μX)(Y−μY)2(X - \mu_X)(Y - \mu_Y) appears, and its expectation is 2Cov(X,Y)2\text{Cov}(X, Y)

The covariance term determines how asset interactions affect portfolio variance. For a two-asset combination with fixed marginal variances and weights of the same sign, negative covariance lowers variance relative to zero covariance. With opposite-sign weights, the covariance contribution reverses sign. Whether the portfolio is less volatile than every constituent also depends on weights, individual volatilities, and constraints.