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:
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?
- Compare the price changes+20 against +0.60
Measured in price, A moved about 33 times as much as B.
- Divide by the starting price20 / 2,000 = 1%; 0.60 / 20 = 3%
Each move as a share of what one share cost.
- 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.
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?
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?
- Apply Monday's return100 × 1.10 = 110
A rise of 10% multiplies the price by 1.10.
- Apply Tuesday's return110 × 0.90 = 99
Tuesday's 10% is taken from 110, not from 100, so it removes 11.
- 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.
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?
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?
- Log return for Mondayln(110 / 100) = ln 1.10 = +0.0953
The natural log of the growth factor.
- Log return for Tuesdayln(99 / 110) = ln 0.90 = −0.1054
A 10% fall is a bigger move in logs than a 10% rise.
- Add them0.0953 − 0.1054 = −0.0101
That's ln(99 / 100), the log return of the whole stretch.
- 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.
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?
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?
- Average the returns(+50% − 50%) / 2 = 0%
The plain average, or arithmetic mean. It sounds like breaking even.
- Compound them1.5 × 0.5 = 0.75
100 grows to 150, then halves to 75: a loss of 25%.
- 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.
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?
Where you'll meet it
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.
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.
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?
2
Monday's log return is +0.05 and Tuesday's is −0.03. What's the simple return over the two days?
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?
What to remember
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%.
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%.
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%.
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.