Sub topic 2
Why weights drift and how to measure it
This chapter assumes you know the basic vocabulary (stocks, bonds, funds, asset classes), can compute a portfolio weight as a share of total value, and can do percentage arithmetic. The Python examples use only the standard library. You can skip them and still follow the ideas.
By the end you will be able to explain why weights move away from a target allocation, and you will have a function that measures that movement in three different ways.
The starting point: a target and a current state
A target allocation is the set of weights you want each asset class to hold, for example 60% stocks and 40% bonds. The weights must add up to 100%. A current weight is an asset class's market value divided by the total market value of the portfolio on the same date.
Drift is the gap between the two:
drift = current weight - target weightA positive drift means the asset class is overweight, so it holds more than you wanted. A negative drift means it is underweight. Everything later in this tutorial depends on this number. Calendar rules, band rules, and trade sizes all start from it.
Why weights drift
You set the weights once, but the market revalues the holdings every day. Three forces move the weights.
- Different returns. An asset that gains more than the rest of the portfolio takes a larger share of the total. This is the main cause.
- Cash flows. A deposit that you do not split in proportion to the target raises one weight and lowers the others. A withdrawal taken from one holding does the same.
- Distributions. Dividends and interest paid out as cash, and not reinvested in proportion, change the mix. So do capital-gain distributions from funds.
The mechanism in one formula
Suppose asset i has weight wi and earns return ri over a period. After the period its new weight is:
new weight_i = w_i * (1 + r_i) / sum over all j of ( w_j * (1 + r_j) )The denominator is the portfolio's growth factor. The weights stay the same only when every asset has the same return, because then every term scales by the same factor and the factor cancels. Drift therefore depends on the difference between returns, not on whether the market went up or down. A year in which stocks and bonds both rise 8% causes no drift at all. A year in which stocks rise 20% and bonds fall 5% causes a lot.
A worked example
Start with 100,000 in a 60/40 portfolio: 60,000 in stocks and 40,000 in bonds. Over one year stocks gain 20% and bonds lose 5%.
- Stocks: 60,000 × 1.20 = 72,000
- Bonds: 40,000 × 0.95 = 38,000
- Total: 110,000
The new weights are 72,000 / 110,000 = 65.45% for stocks and 38,000 / 110,000 = 34.55% for bonds. Stocks have drifted +5.45 percentage points. Bonds have drifted by the same amount in the other direction.
Measuring drift in code
The first function computes weights and drift for a set of asset classes.
targets = {"stocks": 0.60, "bonds": 0.40}
values = {"stocks": 72000.0, "bonds": 38000.0}
total = sum(values.values())
weights = {a: values[a] / total for a in values}
drift = {a: weights[a] - targets[a] for a in targets}
for a in targets:
print(f"{a}: weight {weights[a]:.1%}, drift {drift[a]:+.1%}")This prints roughly stocks: weight 65.5%, drift +5.5% and bonds: weight 34.5%, drift -5.5%. The two drifts are equal and opposite. Across all asset classes, drift always sums to zero, because both the current weights and the targets sum to 100%. If your drifts do not sum to zero, there is an input error, such as a missing holding or targets that do not add up.
Three ways to express drift
Percentage-point drift is not the only useful measure. Later chapters use two of these three, so it helps to separate them now.
| Measure | Formula | Stocks in the example | Bonds in the example |
|---|---|---|---|
| Absolute drift (percentage points) | current weight − target weight | +5.45 points | −5.45 points |
| Relative drift (share of the target) | absolute drift ÷ target weight | +9.1% | −13.6% |
| Dollar drift | market value − target weight × total | +6,000 | −6,000 |
Absolute drift tells you how far the weight has moved. Relative drift tells you how large that move is compared with the size of the position. The same 5.45 points is a small change for a 60% holding and a bigger one for a 40% holding, and it would be huge for a 5% holding. Dollar drift is the amount you would have to trade to return exactly to target, and the trade-calculation chapter builds on it.
The next function returns all three for every asset class, and it checks its inputs.
def measure_drift(values, targets, tolerance=1e-9):
"""Return weight, absolute, relative, and dollar drift per asset class."""
if set(values) != set(targets):
raise ValueError("values and targets must list the same asset classes")
if abs(sum(targets.values()) - 1.0) > tolerance:
raise ValueError("target weights must sum to 1")
total = sum(values.values())
if total <= 0:
raise ValueError("total portfolio value must be positive")
result = {}
for a, target in targets.items():
weight = values[a] / total
abs_drift = weight - target
result[a] = {
"weight": weight,
"abs_drift": abs_drift,
"rel_drift": abs_drift / target if target > 0 else None,
"dollar_drift": values[a] - target * total,
}
return result
targets = {"stocks": 0.60, "bonds": 0.40}
values = {"stocks": 72000.0, "bonds": 38000.0}
for asset, row in measure_drift(values, targets).items():
print(
f"{asset}: weight {row['weight']:.2%}, "
f"abs {row['abs_drift'] * 100:+.2f} pts, "
f"rel {row['rel_drift']:+.1%}, "
f"dollars {row['dollar_drift']:+,.0f}"
)The relative measure returns None when the target is zero, because dividing by a zero target is undefined. A band that is a fraction of the target makes no sense for an asset class you do not want to hold.
Drift accumulates over time
One year of drift is small. Several years without trading compound it, because each year's gains are earned on an already-shifted mix. This simulation starts at 60/40 and applies three years of returns with no rebalancing.
def simulate_no_rebalance(start_values, yearly_returns):
values = dict(start_values)
history = []
for year_returns in yearly_returns:
values = {a: values[a] * (1 + year_returns[a]) for a in values}
total = sum(values.values())
history.append({a: values[a] / total for a in values})
return history
start = {"stocks": 60000.0, "bonds": 40000.0}
returns = [
{"stocks": 0.20, "bonds": -0.05},
{"stocks": -0.10, "bonds": 0.04},
{"stocks": 0.15, "bonds": 0.02},
]
for year, weights in enumerate(simulate_no_rebalance(start, returns), start=1):
print(f"year {year}: stocks {weights['stocks']:.1%}, bonds {weights['bonds']:.1%}")The stock weight goes to about 65.5% after year 1, falls to about 62.1% after the bad year 2, and ends near 64.9% after year 3. Drift does not move in one direction. A down year for stocks pulls the weight back toward the target. Drift is a random walk with a pull toward whichever asset has the stronger long-run return, and in these data stocks win.
What makes drift larger or smaller
- A bigger return gap. Pairing stocks with cash drifts faster than pairing stocks with a stock-heavy balanced fund.
- More volatility in one asset class. A volatile holding changes weight faster than a stable one, even if the long-run average return gap is modest.
- A longer gap between checks. Drift builds up while you are not looking.
- Unmatched cash flows. A regular deposit that goes only to the cash account will pull the mix toward cash, whatever the markets do.
Common measurement errors
Most measurement errors come from the inputs, not the arithmetic.
- Mixing dates. Weights must use values from the same moment. A stock fund priced today and a bond fund priced last week give a false drift.
- Measuring funds instead of asset classes. If you hold three stock funds, the weight that matters for the target is the combined stock value. Group holdings by asset class before measuring.
- Leaving out cash. If cash is part of the policy, or if a pending deposit is meant to be invested, include it as its own class. Leaving it out inflates every other weight.
- Mixing up percent and percentage points. A move from 60% to 65% is 5 percentage points, or 8.3% in relative terms. Always label which one you mean, because a rule written as "5%" is ambiguous.
- Measuring across accounts inconsistently. If your policy covers all accounts together, measure on the combined total. Measuring each account separately gives different drift figures.
What to carry forward
- Weights drift mainly because assets earn different returns. Equal returns cause no drift. Cash flows and distributions also move the mix.
- Drift is current weight minus target weight. It sums to zero across asset classes.
- Express drift as absolute (percentage points), relative (share of target), or dollars. Band rules in later chapters use the first two, and trade sizing uses dollars.
- Drift accumulates and can reverse. The longer you go without checking, the more room it has to grow.
- Check the inputs first: same date, grouped by asset class, all holdings included.
Exercise
A portfolio has a 70/30 target for stocks and bonds. Today the stocks are worth 95,000 and the bonds are worth 35,000. Compute the current weights, the absolute drift in percentage points, the relative drift, and the dollar drift for each asset class.
Show answer
The total is 130,000. The stock weight is 95,000 / 130,000 = 73.08%, so absolute drift is +3.08 points. The bond weight is 35,000 / 130,000 = 26.92%, so absolute drift is -3.08 points. Relative drift is +3.08 / 70 = +4.4% for stocks and -3.08 / 30 = -10.3% for bonds. Dollar drift is 95,000 - 0.70 × 130,000 = +4,000 for stocks, and 35,000 - 0.30 × 130,000 = -4,000 for bonds. The absolute and dollar drifts are equal and opposite across the two classes, as they must be. The relative drift is larger for bonds because bonds are the smaller position.
Exercise
Stocks and bonds both return +8% in the same year, starting from any weights. What happens to the weights, and why?
Show answer
The weights do not change. Each value is multiplied by 1.08, so the total is also multiplied by 1.08, and the ratio of each value to the total is unchanged. Drift comes from differences in returns, not from the level of returns.