Variance and standard deviation

Risk and return
How far can the actual return land from what I expect, and how do I put one number on that spread?

Learning goals

After this page, you can:

  • Compute the variance and the standard deviation of a scenario table in five steps, and in one Excel line.
  • Compute the standard deviation of a list of past returns with STDEV.S, find the best and worst period, and turn monthly numbers into yearly numbers.
  • Read a standard deviation correctly: it is a spread around the average, not a return.

The idea

Two stocks both averaged 6% a year over five years. The yearly returns of Bluestem Dental were 14%, −9%, 22%, 6% and −3%. The yearly returns of a quiet electric utility were 5%, 7%, 6%, 6% and 6%. Same average. Very different sleep. An average tells you where the returns are centered. It does not tell you how far they jump around. We need a second number for that.

Risk as spread. In finance, risk means that the actual return can be different from the return you expect. The wider the possible results spread around the center, the more risk. The usual measure of that spread is the standard deviation, written σ (the Greek letter sigma). It is roughly the typical distance between a result and the average.

From a scenario table: five steps. Start with a table of states, probabilities and returns, and its expected return E.

  1. Deviation. For each state, take the return minus E.
  2. Square each deviation. Squaring makes every number positive, so results above and below the center do not cancel.
  3. Weight each squared deviation by the probability of its state.
  4. Add them up. The total is the variance, written σ².
  5. Take the square root. That is the standard deviation.
Key formula: scenario table

variance σ² = p₁ × (r₁ − E)² + p₂ × (r₂ − E)² + … + pₙ × (rₙ − E)²

standard deviation σ = √σ²

Excel: =SQRT(SUMPRODUCT((returns − E)^2, probabilities))

The variance is in “percent squared”, which nobody can picture. The square root brings it back to percent. So the standard deviation has the same unit as the return.

From history. With a list of past returns there are no probabilities. Every past period counts the same. Excel does the work:

  • =AVERAGE(returns) for the center,
  • =STDEV.S(returns) for the standard deviation,
  • =MAX(returns) and =MIN(returns) for the best and the worst period.

STDEV.S is the sample formula. A sample is a part of the story, not the whole story: five years of returns are only a small piece of everything the stock could do. The sample formula divides the sum of squared deviations by n − 1, not by n. That makes the answer a little larger, which is the honest choice when you have only a sample. (STDEV.P divides by n. Do not use it for past returns.)

From monthly to yearly. Monthly returns are easy to collect, but people compare stocks with yearly numbers. Two rules:

Key formula: annualize

yearly average = monthly average × 12

yearly σ = monthly σ × √12 (√12 is about 3.46)

Why not × 12 for both? Average returns add up month after month. Swings do not: a good month and a bad month partly cancel. So risk grows more slowly than time.

How to read it. A standard deviation of 20% does not mean “the stock earns 20%”. It means that results 20 points above or below the average are quite normal. A stock with an average of 9% and σ of 30% will land much farther from 9%, above or below, than a stock with σ of 12%.

Two kinds of risk. Part of a stock’s spread comes from news about that one company: a product recall, a new chief executive. This is firm-specific risk. An investor who holds many stocks sees most of it wash out, so it is also called diversifiable risk. The rest comes from news that hits almost every company at once, such as a recession or a jump in interest rates. This is systematic risk, or market risk. Holding more stocks does not remove it.

Try it

First, the scenario table. Change a return or a probability and watch the five steps update.

Next, real history. This tool is built for five years of month-end prices for one company and for a fund that follows the whole market (SPY follows the S&P 500 index). It starts with fictional prices. Copy a column of adjusted closing prices from your spreadsheet, oldest first, and paste it into each box. The tool never downloads prices.

What to notice:

  • 61 prices give 60 returns. The tool counts for you and warns you when the two lists do not match.
  • The shaded band in the left chart is the company’s average plus and minus one standard deviation. Most months fall inside it. The months outside it are the ones investors remember.
  • In the right chart, a dot further right has more risk. A dot higher up earned more. Compare the two dots before you read the sentence.

Worked example

Part 1. Scenario table. Harbor Coffee Co. (fictional): recession 20% → −15%, normal 55% → +8%, boom 25% → +24%. The expected return is 7.40%.

State p r r − E (r − E)² p × (r − E)²
Recession 0.20 −15% −22.4% 0.050176 0.010035
Normal 0.55 +8% +0.6% 0.000036 0.000020
Boom 0.25 +24% +16.6% 0.027556 0.006889
Variance 0.016944

Standard deviation = √0.016944 = 0.1302 = 13.02%.

Part 2. A list of past returns. Bluestem Dental (fictional): +14%, −9%, +22%, +6%, −3%.

Step 1. Average. (14 − 9 + 22 + 6 − 3) ÷ 5 = 30 ÷ 5 = 6.00%.

Step 2. Deviations and squares (in percent): 8, −15, 16, 0, −9 → 64, 225, 256, 0, 81. Sum = 626.

Step 3. Divide by n − 1. 626 ÷ 4 = 156.5.

Step 4. Square root. √156.5 = 12.51%. Excel: =STDEV.S(A1:A5). The best year was +22%, the worst −9%.

This small tool does the same for any list.

Part 3. Monthly to yearly. A stock has a monthly average of 1.2% and a monthly σ of 6.5%. Yearly average: 1.2% × 12 = 14.4%. Yearly σ: 6.5% × √12 = 6.5% × 3.464 = 22.5%. For comparison, the whole U.S. stock market has had a yearly σ of roughly 17%.

Answer. Harbor Coffee: σ = 13.02%. Bluestem Dental: average 6.00%, σ = 12.51%. The monthly stock: 14.4% a year with σ of 22.5%.

Check yourself

Check 1.

A stock returns −10% or +30% with equal probability. Expected return 10%. Its standard deviation is:

Variance = Σ p × (r − E)²; standard deviation = √variance, in the same units as the return.

Check 2.

Three annual returns: 10%, 20%, 30%. Using the sample formula (Excel STDEV.S), the standard deviation is:

Historical returns are a sample: =STDEV.S divides by n − 1.

Check 3.

A stock’s monthly returns have a standard deviation of 5%. The annualized standard deviation is about:

Average × 12; standard deviation × √12 (variance adds, σ is its square root).

Check 4.

Two stocks both have an expected return of 9%. Stock A has σ = 12%, Stock B has σ = 30%. Which is true?

Standard deviation measures how far outcomes spread around the expected return — total risk.

Check 5.

Ridgeline Outfitters’ stock drops 6% the day a product is recalled; the market is flat. For a diversified investor this is:

Diversifiable risk comes from one-company events and disappears in a portfolio; systematic risk does not.

Video

Video coming soon.