Sub topic 1
Returns and compounding: the baseline
Prerequisites
This chapter assumes you know:
- What a stock, an index fund and a bond are, at the level of "an ownership share", "a basket of shares" and "a loan that pays interest".
- How to read a percentage return, such as "the fund rose 8% this year".
- Basic Python: loops, functions and
print. The snippets are short, and you can skip them and still follow the text.
Later chapters ask what happens when you leave the market and miss some of its best days. To judge that, you need a baseline for how money grows when you stay invested. This chapter builds that baseline.
Simple return, total return and real return
A return is the change in value over a period, divided by the starting value. If 100 becomes 108, the return is 8%.
Three variants matter for the rest of the tutorial:
- Price return counts only the change in the share price.
- Total return also counts dividends (cash paid to shareholders), assuming they are reinvested. Long-run stock figures are normally quoted as total return, because dividends make up a large share of the long-run result.
- Real return subtracts inflation, the rise in prices. The formula is
(1 + nominal) / (1 + inflation) - 1. A 7% nominal return with 3% inflation gives 1.07 / 1.03 - 1, or about 3.9%. It does not give 4%.
Keep the three apart when you compare numbers. A chart of price return can look much worse than a chart of total return for the same fund.
Compounding: returns multiply
Compounding means each period's return is earned on the previous period's ending value, including earlier gains. Returns therefore multiply. They do not add.
For returns r1, r2, ..., rn, the ending value of 1 unit of money is:
(1 + r1) × (1 + r2) × ... × (1 + rn)
The loop in the code below does exactly this. It is the same calculation that the later simulation of missed best days uses.
Growth of 100 at a steady 7% a year shows why time matters:
for years in (10, 20, 30):
print(years, round(100 * 1.07 ** years, 1))
# 10 196.7
# 20 387.0
# 30 761.2| Years | Value of 100 at 7% a year | Gain in the period |
|---|---|---|
| 10 | 196.7 | +96.7 |
| 20 | 387.0 | +190.3 |
| 30 | 761.2 | +374.2 |
The last decade adds 374 on its own, more than the first twenty years combined. Most of the final value arrives late. A rough check is the rule of 72: divide 72 by the annual return in percent to estimate years to double. At 7% that gives about 10.3 years, and the exact figure is 10.2.
Arithmetic average versus compound growth
The average of yearly returns can mislead. Suppose a fund gains 50% one year and loses 50% the next. The simple average is 0%, yet the investor ends with less money:
def total_return(returns):
value = 1.0
for r in returns:
value *= 1 + r
return value - 1
def annualized(returns):
n = len(returns)
return (1 + total_return(returns)) ** (1 / n) - 1
yearly = [0.50, -0.50]
print(sum(yearly) / len(yearly)) # 0.0
print(round(total_return(yearly), 4)) # -0.25
print(round(annualized(yearly), 4)) # -0.134100 becomes 150, then 75. The annualized return (also called the geometric average or compound annual growth rate) is -13.4% a year. It is the single constant yearly rate that would produce the same ending value. When you judge an investment, use the annualized return, not the arithmetic average.
The gap between the two averages grows with volatility, which is how widely returns swing. Two funds with the same arithmetic average will end at different values if one swings more. This is one reason the next chapter looks at volatility.
Losses are asymmetric
A loss needs a larger gain to get back to even. If you lose a fraction L, you need a gain of L / (1 - L) to recover.
for loss in (0.10, 0.20, 0.30, 0.50):
print(loss, round(loss / (1 - loss), 3))
# 0.1 0.111
# 0.2 0.25
# 0.3 0.429
# 0.5 1.0| Loss from peak | Gain needed to recover |
|---|---|
| 10% | 11.1% |
| 20% | 25.0% |
| 30% | 42.9% |
| 50% | 100.0% |
The asymmetry comes from the base changing. After a 50% fall you hold half as much money, so you must double it to return to the start. This is a basic reason large drawdowns hurt more than their headline size suggests.
What the baseline tells you
Keep these four facts in mind for the rest of the tutorial:
- Growth is multiplicative. Every period's return applies to everything accumulated so far, so a single very good or very bad period can change the final value a lot.
- Time carries most of the result. In the 7% example, the third decade adds more than the first two together.
- Averages hide losses. Use annualized (geometric) returns and look at the worst falls, not only the mean.
- Small drags compound too. A cost of 1% a year turns 7% growth into 6%. Over 30 years, 100 grows to about 574 instead of 761, roughly a quarter less. The chapter on trading costs and taxes returns to this.
Edge cases and common errors
- Adding percentages across years. Gaining 10% and then 10% is 21% in total, not 20%. Losing 10% and then 10% is 19%, not 20%.
- Comparing returns over different periods. A 60% total return over 5 years is not a better result than 100% over 12 years. Convert both to annualized figures first. Here that gives about 9.8% and 6.0% a year.
- Mixing nominal and real figures. A 30-year chart in nominal terms can hide the fact that prices rose a lot over the same period.
- Treating a simulation as history. The code in this tutorial uses made-up returns to show mechanics. Real markets have different volatility, fat tails and clusters of bad days, so use the numbers for intuition only.
- Ignoring starting point. A long-run average return says nothing certain about the next ten years. Returns over a decade have varied widely, and later chapters cover lost decades.
Where this leads
With the baseline in place, the next chapter looks at the other side of compounding: volatility and drawdowns. A market that averages a good return still falls sharply along the way, and the size of those falls explains why investors are tempted to step aside. The code snippet for maximum drawdown, the largest peak-to-trough fall, appears there.
Exercise
A portfolio worth 100 falls 40% in a downturn. (a) What gain is needed to get back to 100? (b) If that gain then arrives over 4 equal annual returns, what annual return is required? Give both answers to one decimal place.
Show answer
(a) After a 40% fall the portfolio is worth 60, so the gain needed is 0.40 / (1 - 0.40) = 0.667, or 66.7%. (b) The four yearly returns must multiply to 1.667, so the annual return is 1.667 ** (1/4) - 1. The fourth root of 1.667 is about 1.1362, so the required return is about 13.6% a year.
Exercise
A fund returns +30%, -20% and +10% in three consecutive years. Compute the total return and the annualized return. Why is the annualized figure lower than the arithmetic average of 6.7%?
Show answer
The ending value of 1 unit is 1.30 × 0.80 × 1.10 = 1.144, so the total return is 14.4%. The annualized return is 1.144 ** (1/3) - 1, which is about 4.6% a year. It is lower than the 6.7% arithmetic average because returns multiply. A year with a loss reduces the base on which later gains are earned, and the more the yearly returns vary, the larger the gap between the two averages.