insideout Get Pro

02 · Volatility clusters

Free

Time Series, lesson 2

Volatility clusters

Calm and wild stretches, and how to measure volatility.

Two stocks can have the same average return and very different risk: one moves half a percent on a normal day, the other 3%. This lesson measures that size and shows how it changes over time. You need returns, from the last lesson, and what a standard deviation is.

By the end, you can:

  1. Measure volatility from a list of daily returns.
  2. Scale a daily volatility to any number of days with the square root of time.
  3. Spot volatility clustering, and say what it means for tomorrow's risk.
  4. Measure volatility over a rolling window, and choose its length.

Part 1. The size of a typical move

Measure volatility from a list of daily returns.

Daily returns hover around a small average. What sets one stock apart from another is how far they stray from it. Statistics already has a measure for that: the standard deviation.

Example 1.1

Five days of returns

A stock's returns over five days were +1%, −2%, +0.5%, +1.5% and −1%. How big is a typical day's move?

  1. Find the average(1 − 2 + 0.5 + 1.5 − 1) / 5 = 0%

    Here it's exactly zero, which keeps the next step simple.

  2. Square each distance from it1, 4, 0.25, 2.25, 1

    In %². Squaring makes a fall count as much as a rise, and big moves count most.

  3. Average the squares over n − 18.5 / 4 = 2.125

    That's the variance. Dividing by n − 1 makes up for measuring from an average taken from the same five days.

  4. Take the square root√2.125 = 1.46%

    Back to percent: the daily volatility.

Answer1.46% a day.

Squaring, averaging and taking the root gives a typical distance from the average. Big days weigh more than in a plain average of the sizes, which here is 1.2%. Before the root, the −2% day counts four times as much as a 1% day.

Volatility

Volatility is the standard deviation of returns: how far a return typically lands from the average. It's written σ, "sigma". Read the formula as "the square root of the squared distances from the average, added up and divided by n − 1".

σ = √( Σ (rᵢ − r̄)² / (n − 1) )

Over months of data, the average daily return is tiny next to the moves, so desks often treat it as zero: square the returns, average them over n, take the root. With 20 or more days the answer barely changes. And volatility says nothing about direction. It measures size only.

Your turn

Four daily returns: +2%, −2%, +1% and −1%. What's the volatility?

The average is 0. The squares are 4, 4, 1 and 1, adding to 10. Over n − 1 = 3 that's 3.33, and the square root is 1.83%. 3.33 is the variance, before the root, 1.58% divides by 4 instead of 3, and 1.5% is the plain average of the sizes.

Part 2. From a day to a year

Scale a daily volatility to any number of days with the square root of time.

Volatility is usually quoted per year, so stocks, funds and options compare on one scale. A year has about 252 trading days. Turning a daily figure into a yearly one takes one fact: the variances of independent days add up.

Example 2.1

A year from a day

A stock's daily volatility is 1.46%, and its days are independent. What's its volatility over a year of 252 trading days?

  1. Start from the daily varianceσ² = 2.125

    In %², from the five days in part 1. Variances of independent days add up. Volatilities don't.

  2. Add up a year of days252 × 2.125 = 535.5

    A year's log return is the sum of 252 daily ones, so its variance is the sum of 252 daily variances.

  3. Take the square root√535.5 = 23.1%

    The same as 1.46% × √252, and √252 is about 15.9.

AnswerAbout 23.1% a year.

Volatility grows with the square root of time because ups and downs partly cancel. Over 4 days the spread is √4 = 2 times a day's, not 4 times. Over 252 days it's about 15.9 times.

5%10%15%20%016324864days1% × daysif moves never cancelled16 days: 4%64 days: 8%1% × √days
Figure 1At 1% a day, the spread over 16 days is 4% and over 64 days 8%. If every move went the same way, it would grow in a straight line.

The square-root-of-time rule

If days are independent, the volatility over T days is the daily volatility times √T. Turned into a yearly figure this way, a volatility is annualised.

σ over T days = σ a day × √T

Two traps. Multiplying by 252 instead of √252 turns 1.46% a day into 368% a year. And the rule needs independent days. If moves tend to continue, a week spreads more than √5 days' worth, and if they snap back, less. "Random walk or not" turns that into a test.

Your turn

A stock's daily volatility is 2%. If days are independent, what's its volatility over 4 days?

Variances add: 4 × 2² = 16, and √16 = 4%. Volatility grows with the square root of time, so 4 days is twice one day, not four times.

Part 3. Volatility comes in clusters

Spot volatility clustering, and say what it means for tomorrow's risk.

One number for a whole year suggests every day is drawn with the same spread. Look at a year of a practice stock day by day and that's plainly not so: months of calm, then a storm.

The year as it happened+3%−3%The same 252 days, shuffled+3%−3%first 180 days: 0.69% a daylast 40: 2.46%
As it happened+3%−3%The same days, shuffled+3%−3%first 180 days: 0.69%last 40: 2.46%
Figure 2A year of a practice stock's daily returns, with moves beyond 3% in orange. The first 180 days moved about 0.69% a day and the last 40 about 2.46%. Shuffle the same days and the storm spreads out.

Example 3.1

Big days after big days

In that year, 10 of the 252 days moved more than 3%, up or down. How often was the day after a big day big as well? Compare it with the same days shuffled.

  1. Find how common big days are10 / 252 = 4.0%

    With no clustering, the day after a big day would be big about this often too.

  2. Check the day after each one4 / 10 = 40%

    Four of the ten big days were followed by another.

  3. Compare the two40% / 4.0% = 10

    A big day made the next day ten times as likely to be big.

  4. Shuffle the days and count again0 / 10 = 0%

    Same moves, same volatility, a new order: the bunches are gone.

AnswerAfter a big day, another big day was ten times as likely.

Volatility isn't fixed. It drifts through calm spells and stormy ones that last for weeks. A big day is a sign you're in a storm, and storms don't end overnight. So the size of yesterday's move says something about the size of today's.

Volatility clustering

Big moves tend to follow big moves, of either sign, and small moves tend to follow small ones. The direction of tomorrow's move stays hard to guess. Its size doesn't.

Clustering is about size, not direction. In the storm above, falls and rises came in turns: +5.3% then −3.2%, and −3.4% then +6.5%. So after a big fall, don't expect a bounce or another fall. Expect a wide range.

Your turn

Over 800 days, 40 days moved more than 3%. Of the 40 days right after them, 12 moved more than 3% too. How much more likely is a big day right after a big one?

Big days are 40 / 800 = 5% of all days. After a big day, 12 / 40 = 30% were big. 30% / 5% = 6 times as likely. Comparing 12 with 40 forgets that big days are rare to begin with.

Part 4. Volatility over a recent window

Measure volatility over a rolling window, and choose its length.

Since volatility drifts, a figure from five years of data describes an average year, not this week. Desks measure it over the last few weeks instead, and recompute it every day as the window moves on.

Example 4.1

A big day leaves the window

You measure volatility over the last 20 days, taking the average return as zero. Nineteen of the days moved 1%, up or down, and one fell 6%. What's your estimate? What is it on the day the 6% fall leaves the window, if that day moves 1%?

  1. Square and add the 20 days19 × 1 + 36 = 55

    In %². The one big day supplies almost two thirds of the total.

  2. Average and take the root√(55 / 20) = 1.66%

    With the average taken as zero, divide by n.

  3. Swap the big day for a 1% day√(20 / 20) = 1.00%

    Nothing unusual happened that day, and the estimate fell by 40%.

Answer1.66%, falling to 1.00% the day the big move drops out.

In a plain window every day counts fully until it leaves, then not at all. So one event moves the estimate twice: once when the big day arrives, and again 20 days later, on a day when nothing happened.

20-day volatility1%2%1.66%1.00%1.00%Each day's return−6%entersleaves, 20 days later
Figure 3The 20-day volatility jumps when the −6% day enters the window and drops when it leaves, 20 days later. In between it holds at 1.66%, as if the storm went on.

Rolling volatility

Rolling volatility is volatility measured over the last w days and recomputed every day as the window moves forward. w is the window's length.

The length is a trade. A short window reacts fast but jumps around, because a handful of days can't pin a spread down. A long one is smooth but late: it keeps a storm in its estimate for months after the storm ends. "Volatility models" lets old days fade out instead.

Your turn

You use a 60-day window. A −8% day happened 60 days ago, and today it drops out of the window. What happens to your estimate?

In a plain window every day counts fully until it leaves, then counts for nothing. The estimate drops on a day when nothing happened. "Volatility models" fixes this by letting old days fade instead.

Where you'll meet it

In interviews

Expect quick ones: annualise a daily volatility, scale it to a week, and say why it's √252 and not 252. Then the judgement calls: when the square-root rule fails, what a big down day means for tomorrow's risk, and how long a window you'd use, and why.

On the job

Rama Cont's 2001 survey lists volatility clustering among the stylised facts found across a wide range of instruments, markets and periods. Benoit Mandelbrot had described it in 1963, studying speculative prices: large changes tend to be followed by large changes, of either sign. So risk desks estimate volatility from recent data and update it every day.

The practice stock's year, in Python
import numpy as np

rng = np.random.default_rng(339)
r, var = np.zeros(252), 0.0001
for t in range(252):  # volatility that builds after big days, then fades
    r[t] = np.sqrt(var) * rng.standard_normal()
    var = 0.000002 + 0.10 * r[t] ** 2 + 0.88 * var

def big_after_big(x):  # big days, and big days right after a big day
    big = np.abs(x) > 0.03
    return int(big.sum()), int((big[:-1] & big[1:]).sum())

vol = r.std(ddof=1)
print(f"{vol:.2%} a day, {vol * np.sqrt(252):.1%} a year")
print(f"first 180 days {r[:180].std(ddof=1):.2%}, last 40 {r[-40:].std(ddof=1):.2%}")
print("as it happened", big_after_big(r), "shuffled", big_after_big(rng.permutation(r)))

# Output:
# 1.18% a day, 18.8% a year
# first 180 days 0.69%, last 40 2.46%
# as it happened (10, 4) shuffled (10, 0)

Check yourself

Three questions from across the lesson. Try each one before you look back.

1

Yesterday a stock fell 4%, one of its biggest moves this year. What's the best guess for today?

Clustering is about size, not direction. The average move stays near zero, but the range of likely moves is much wider after a big day. Risk systems raise their estimates after a day like that for this reason.

2

A stock's volatility is quoted as 32% a year. About how big is a typical daily move?

Divide by √252 ≈ 15.9: 32% / 15.9 ≈ 2% a day. Dividing by 252 treats volatility as if it added up day by day, when it's the variance that adds. 9.2% is 32% / √12, a typical month's move.

3

Over a 10-day window, eight days were flat, one rose 3% and one fell 3%. Taking the average return as zero, what's the volatility?

Square and add: 9 + 9 = 18. Average over the 10 days: 1.8. The square root: 1.34%. 1.8 is the variance, before the root, and 0.6% is the plain average of the sizes.

What to remember

  1. 1The size of a typical move

    Volatility is the standard deviation of returns: +1%, −2%, +0.5%, +1.5% and −1% give 1.46% a day.

  2. 2From a day to a year

    If days are independent, volatility grows with the square root of time: 1.46% a day is 1.46% × √252 ≈ 23.1% a year.

  3. 3Volatility comes in clusters

    Volatility clusters: in the practice stock, a big day made the next day ten times as likely to be big, in either direction.

  4. 4Volatility over a recent window

    A rolling window counts each day fully until it leaves, so one −6% day lifts a 20-day estimate from 1.00% to 1.66% and drops it 20 days later.

Time Series overviewSpotted a mistake? Tell us.