Sub topic 2
Time-weighted return when cash moves in and out
This chapter assumes you know percentage returns, compounding, mean and standard deviation, and basic pandas or numpy. The examples use Python.
Time-weighted return
When you add or withdraw money, a simple percentage change misstates performance. The time-weighted return (TWR) removes the effect of cash flows by splitting the period at each flow, computing the return of each sub-period, and geometrically linking them.
In the example below, the portfolio gains 10% after the start, then receives a 1,000 deposit, then falls 10%. Linking the sub-period growth factors gives 1.10 × 0.90 = 0.99, so the TWR is -1%.
subperiods = [(1000.0, 1100.0), (2100.0, 1890.0)] # (start value, end value before next flow)
growth = 1.0
for start, end in subperiods:
growth *= end / start
print(round(growth - 1, 4)) # -0.01Money-weighted return
The money-weighted return (MWR), also called the internal rate of return, reflects your own timing. It is the rate that makes the present value of all cash flows equal zero. In the same example you invested 1,000, then added 1,000, and ended with 1,890. Because the deposit arrived just before the decline, the MWR is about -3.7% per period, worse than the TWR of -1%. Your money lost 110 on 2,000 invested. The TWR measures the manager's skill, and the MWR measures your results.
Tracking error
Tracking error is the standard deviation of the difference between portfolio and benchmark returns, usually annualized for monthly data by multiplying by the square root of 12. A low value means the portfolio stays close to its benchmark. A high value means it drifts from it.
Beta and alpha
Beta measures how much the portfolio moves with the benchmark. It equals the covariance of the two return series divided by the variance of the benchmark. A beta of 1.2 suggests the portfolio tends to move 1.2% for each 1% move in the benchmark. Alpha is the return left after adjusting for beta. The code below computes tracking error and beta from monthly returns.
import numpy as np
rp = np.array([0.02, -0.01, 0.03, 0.01])
rb = np.array([0.015, -0.02, 0.025, 0.005])
active = rp - rb
tracking_error = active.std(ddof=1) * np.sqrt(12)
beta = np.cov(rp, rb, ddof=1)[0, 1] / np.var(rb, ddof=1)
print(round(tracking_error, 4), round(beta, 4))Exercise
A portfolio gains 5% in the first month, then loses 5% in the second month, with no cash flows. What is the time-weighted return?
Show answer
The growth factors are 1.05 and 0.95. Their product is 0.9975, so the return is -0.25%.