insideout Get Pro

01 · Prices and returns

Free

Time Series, lesson 1

Prices and returns

Why quants model returns, not prices, and simple against log returns.

Quants rarely model prices directly. They turn them into returns first, and this lesson shows why and how. You need percentages and a calculator with a log key. No finance or code needed.

By the end, you can:

  1. Compute a return, and compare moves on stocks at very different prices.
  2. Chain daily returns into one return over several days.
  3. Convert between simple and log returns, and add log returns across days.
  4. Tell a fund's average return from the return it actually made.

Part 1. Returns put stocks on one scale

Compute a return, and compare moves on stocks at very different prices.

A price on its own says little about risk. A move of 20 is a lot for a stock at 50 and almost nothing for one at 5,000. Take two practice stocks: A trades near 2,000 and B near 20.

Example 1.1

Two stocks, one day

Stock A goes from 2,000 to 2,020 in a day. Stock B goes from 20.00 to 20.60. You have 1,000 invested in each. Which holding moved more?

  1. Compare the price changes+20 against +0.60

    Measured in price, A moved about 33 times as much as B.

  2. Divide by the starting price20 / 2,000 = 1%; 0.60 / 20 = 3%

    Each move as a share of what one share cost.

  3. Apply it to 1,000 in each1,000 × 1% = 10; 1,000 × 3% = 30

    Money in a stock grows by the percentage, whatever the share price.

AnswerB's holding moved three times as much: +3% against +1%.

What you own is an amount of money in a stock, and that money moves by percentages. A return measures exactly that, so a stock at 2,000 and a stock at 20 land on one scale. Over sixty days the picture holds: in money, A seems to do all the moving, and as returns, B is the wild one.

Change in price, each dayAabout 20Babout 0.60Return, each dayAabout 1%Babout 3%
Figure 1Sixty days of the two practice stocks. In money, B's daily changes barely leave the line. As returns, B's bars are about three times as tall as A's.

Return

A return is a price change as a share of the starting price. With P₀ the starting price and P₁ the new one, r = P₁ / P₀ − 1, read "the new price over the old, minus one".

2,020 / 2,000 − 1 = 0.01 = +1%

There's a second reason to use returns. A price is yesterday's price plus a move, so it drifts wherever the moves take it, and its long-run average is no target. Daily returns hover around a small average with a spread that changes slowly. "Stationarity" makes that precise.

One trap: compute returns from prices adjusted for splits and dividends. A 2-for-1 split halves the price overnight and nobody loses any money, but raw prices would show a −50% day.

Your turn

Stock X goes from 50 to 52. Stock Y goes from 400 to 410. Which had the bigger return?

52 / 50 − 1 = 0.04 and 410 / 400 − 1 = 0.025. Y gained more per share, but each share cost eight times as much. Per unit of money put in, X did better.

Part 2. Chaining returns

Chain daily returns into one return over several days.

A return covers one step. Over a week you want one number for the whole stretch, and adding the daily returns is the natural guess. Test it on two days.

Example 2.1

Up 10%, then down 10%

A stock at 100 rises 10% on Monday and falls 10% on Tuesday. Where does it end, and what's its two-day return?

  1. Apply Monday's return100 × 1.10 = 110

    A rise of 10% multiplies the price by 1.10.

  2. Apply Tuesday's return110 × 0.90 = 99

    Tuesday's 10% is taken from 110, not from 100, so it removes 11.

  3. Read off the two-day return99 / 100 − 1 = −1%

    Adding the two returns gave 0%, which never happened.

AnswerIt ends at 99: a two-day return of −1%.

Each return is measured from a different starting price, so returns don't add. What carries over from one day to the next is the multiplier, 1 + r. Chain the multipliers and you get the whole stretch: 1.10 × 0.90 = 0.99.

10011099×1.10×0.90Returns add to 0%Real change: −1%10050100×0.5×2Returns add to +50%Real change: 0%+10%, then −10%−50%, then +100%
Figure 2Returns multiply. +10% then −10% loses 1%. −50% then +100% ends where it started, though the two returns add to +50%.

Growth factor and compounding

1 + r is the growth factor, the number the price gets multiplied by. Chaining returns by multiplying their growth factors is compounding:

(1 + r₁) × (1 + r₂) × … × (1 + rₙ) − 1

The bigger the moves, the further off adding gets. For daily moves near 1% the error is tiny: +1% twice compounds to +2.01%. For −50% then +100% it's off by 50 points. A halved price needs a 100% rise to get back.

Your turn

A stock falls 20% in a day. What return the next day takes it back to where it started?

After the fall the price is 0.80 of what it was. Getting back needs a growth factor of 1 / 0.80 = 1.25: a rise of 25%. A rise of 20% only reaches 0.80 × 1.20 = 0.96, still 4% down.

Part 3. Log returns add up

Convert between simple and log returns, and add log returns across days.

Multiplying growth factors works, but it's clumsy over 250 days, and most statistics is built on sums and averages. Logs turn the multiplying into adding, because the log of a product is the sum of the logs.

Example 3.1

The same two days, in logs

Redo 100 → 110 → 99 with natural logs. What's each day's log return, and what's the return over both days?

  1. Log return for Mondayln(110 / 100) = ln 1.10 = +0.0953

    The natural log of the growth factor.

  2. Log return for Tuesdayln(99 / 110) = ln 0.90 = −0.1054

    A 10% fall is a bigger move in logs than a 10% rise.

  3. Add them0.0953 − 0.1054 = −0.0101

    That's ln(99 / 100), the log return of the whole stretch.

  4. Turn it back into a simple returne^−0.0101 − 1 = −1.00%

    Raise e to the log return and subtract 1.

AnswerA two-day log return of −0.0101, which is −1% as a simple return.

ln(a × b) = ln a + ln b. Growth factors multiply across days, so their logs add. The log return over a week is the sum of its five daily log returns, and a sum of many small pieces is exactly what statistics handles best.

Log return

The log return is ℓ = ln(P₁ / P₀), read "the natural log of the new price over the old". Over several days, log returns add up to the log return of the whole stretch. The plain kind, P₁ / P₀ − 1, is the simple return.

ln(P₃ / P₀) = ℓ₁ + ℓ₂ + ℓ₃

For small moves the two kinds nearly agree: ℓ is about r − r² / 2, so at 1%, ln 1.01 = 0.00995. For big moves they part ways. Halving is −0.693 in logs and doubling is +0.693, the same size, so a fall and the rise that undoes it cancel exactly.

2550100200400halve−0.693double+0.693price, on a log scale
Figure 3On a log scale every doubling is the same distance. Halving from 100 to 50 and doubling to 200 are log returns of −0.693 and +0.693.

Your turn

A stock's log returns over five days are +0.02, −0.01, +0.03, −0.02 and +0.01. What's its simple return over the five days?

The log returns add to 0.03, so the five-day growth factor is e^0.03 = 1.0305: a simple return of 3.05%. Add in logs, convert once at the end.

Part 4. Average and compound returns

Tell a fund's average return from the return it actually made.

Funds often quote an average yearly return. When returns swing, that average can be far from what an investor made. Interviewers like this one.

Example 4.1

+50%, then −50%

A fund returns +50% one year and −50% the next. What's its average yearly return, what did an investor make, and what steady yearly rate would have done the same?

  1. Average the returns(+50% − 50%) / 2 = 0%

    The plain average, or arithmetic mean. It sounds like breaking even.

  2. Compound them1.5 × 0.5 = 0.75

    100 grows to 150, then halves to 75: a loss of 25%.

  3. Find the steady yearly rate√0.75 − 1 = −13.4%

    Two years at −13.4% also end at 0.75. This is the geometric mean.

AnswerAn average of 0%, a loss of 25%, or −13.4% a year.

The fall is taken from 150, and the rise was taken from 100. So the fall removes more money than the rise added. Every swing up and back down does this, and the wider the swing, the bigger the loss.

501501000123456years+50%−50%average return 0%42−13.4% a year
Figure 4Six years of +50% and −50% take 100 down to 42, though the average return is 0%. A steady −13.4% a year meets the path every two years.

Geometric mean and volatility drag

The geometric mean is the steady rate that compounds to the same end: the n-th root of the total growth factor, minus 1. Its gap below the plain average is volatility drag. Roughly, with σ the spread of the returns:

geometric ≈ arithmetic − σ² / 2

Here σ is 50%, since each return sits 50 points from the average, so the drag is about 0.5² / 2 = 12.5%, close to the exact 13.4%. The rule of thumb is good for small swings. Two funds with the same average can end with different money, and the wilder one ends with less.

Your turn

A fund returns +20% one year and −10% the next. What steady yearly rate would have done the same?

Compound: 1.20 × 0.90 = 1.08, and √1.08 − 1 = 3.9% a year. 5% is the plain average, and 8% is the total over both years. The rule of thumb agrees: σ is 15%, and 5% − 0.15² / 2 ≈ 3.9%.

Where you'll meet it

In interviews

Quick versions of this lesson come up often: why returns and not prices, chaining returns, turning a log return into a simple one, and the +50%, −50% fund. Work in growth factors out loud. "1.5 × 0.5 = 0.75, so a 25% loss" is faster than any formula.

On the job

Desks keep prices but do most of their maths on returns. Log returns go into models and multi-day sums, because they add across time. Simple returns go into portfolios, because a portfolio's simple return is the weighted average of its holdings' simple returns, and log returns don't average that way.

Simple and log returns, in Python
import numpy as np

prices = np.array([100.0, 110.0, 99.0])
simple = prices[1:] / prices[:-1] - 1     # P1 / P0 - 1
logret = np.diff(np.log(prices))          # ln(P1 / P0)
print(simple, logret.round(4))
print(f"compounded {np.prod(1 + simple) - 1:+.2%}, from the logs {np.exp(logret.sum()) - 1:+.2%}")

r = np.array([0.5, -0.5])
g = np.prod(1 + r)
print(f"average {r.mean():.1%}, total {g - 1:.1%}, per year {g ** 0.5 - 1:.1%}")

# Output:
# [ 0.1 -0.1] [ 0.0953 -0.1054]
# compounded -1.00%, from the logs -1.00%
# average 0.0%, total -25.0%, per year -13.4%

Check yourself

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

1

A stock averaged 80 over the past ten years. It's at 150 today. What does the 80 tell you?

A price wanders with no anchor, so its long-run average isn't a target. Maybe the company grew. To ask whether something tends to come back, you need a series that does come back, which "Mean reversion" is about.

2

Monday's log return is +0.05 and Tuesday's is −0.03. What's the simple return over the two days?

Log returns add: 0.05 − 0.03 = 0.02. Convert once at the end: e^0.02 − 1 = 2.02%. Compounding them as if they were simple returns, 1.05 × 0.97 − 1, gives 1.85%, which mixes up the two kinds.

3

Two funds both average +10% a year over two years. Fund A made +10% each year. Fund B made +40%, then −20%. Which ended with more?

A: 1.10 × 1.10 = 1.21. B: 1.40 × 0.80 = 1.12. Same average, less money for the fund that swings. The order doesn't matter, since 0.80 × 1.40 is also 1.12.

What to remember

  1. 1Returns put stocks on one scale

    A return is a price change as a share of the starting price, r = P₁ / P₀ − 1, so 2,000 to 2,020 and 20 to 20.20 are both +1%.

  2. 2Chaining returns

    Returns over several days compound: multiply the growth factors, so +10% then −10% is 1.10 × 0.90 = 0.99, a loss of 1%.

  3. 3Log returns add up

    Log returns, ln(P₁ / P₀), add across days, and e^ℓ − 1 turns a sum back into a simple return: log returns adding to 0.03 make +3.05%.

  4. 4Average and compound returns

    Swings drag compound growth below the average: +50% then −50% averages 0% but loses 25%, or 13.4% a year.

Time Series overviewSpotted a mistake? Tell us.