Sub topic 12
Project whether your savings reach the target
This chapter assumes you can read basic Python, you understand compound growth, and you already have a target nest egg from the earlier chapters. In the running example the target is 900,000 in today's dollars, from a 36,000 annual gap at a 4% withdrawal rate. You also need rough figures for your current balance and yearly contributions.
The goal here is a yes-or-no check with a margin. Do today's savings, plus future contributions, grow to the target by the retirement age you chose? The answer is a range that depends on the return assumption, not a single number.
Work in real dollars
The target nest egg is in today's dollars. A projection is only comparable to it if it is also in today's dollars. There are two consistent ways to do this:
- Project in nominal dollars. Inflate the target to the retirement date and use nominal returns and nominal contribution growth.
- Project in real dollars. Use a real return and keep contributions at a constant real amount.
The real approach has fewer moving parts, so this chapter uses it. The real return is the nominal return adjusted for inflation:
real return = (1 + nominal return) / (1 + inflation) - 1
A 7% nominal return with 3% inflation gives 1.07 / 1.03 - 1, which is about 3.88%. Subtracting the two rates (7% - 3% = 4%) is close but slightly overstates the result. The gap grows as inflation rises.
A constant real contribution means your contribution rises each year at the rate of inflation. If you fix it at 15,000 nominal for 25 years, its buying power shrinks. Either raise it with inflation, or model the lower real value yourself.
The projection loop
The loop below grows the balance by one year of real return, then adds that year's contribution. Contributions are added at year end, which is a slightly conservative assumption. Real contributions arrive through the year and start earning sooner.
def project_savings(balance, annual_contribution, real_return, years):
"""Grow a balance in today's dollars, adding contributions at each year end."""
for _ in range(years):
balance = balance * (1 + real_return) + annual_contribution
return balance
projected = project_savings(
balance=100_000,
annual_contribution=15_000,
real_return=0.05,
years=25,
)
print(f"{projected:,.0f}") # about 1,054,500The result is about 1,054,500, against a target of 900,000. The plan clears the target by roughly 154,500 under these assumptions.
The loop is the same as a closed-form formula. The starting balance grows by (1 + r)^n. Each contribution grows for the years it remains invested, and the contributions sum to a factor of ((1 + r)^n - 1) / r. The loop is easier to extend, for example to change contributions in specific years or to stop contributing early.
flowchart TDThe diagram block below shows the full check as a flow.
Test the return assumption
The return is the least certain input, and small changes compound over decades. Run the same plan across several real returns before you trust the answer:
def project_savings(balance, annual_contribution, real_return, years):
for _ in range(years):
balance = balance * (1 + real_return) + annual_contribution
return balance
target = 900_000
for real_return in (0.03, 0.05, 0.07):
result = project_savings(100_000, 15_000, real_return, 25)
status = "meets" if result >= target else "misses"
print(f"{real_return:.0%}: {result:>12,.0f} {status} target")The output is about 756,300 at 3% (a shortfall of roughly 143,700), about 1,054,500 at 5%, and about 1,491,500 at 7%. The plan passes at 5% and 7% and fails at 3%. That spread shows how much the conclusion depends on one assumption.
Pick a base case that is conservative for your portfolio. A stock-heavy portfolio might use 4% to 5% real. A bond-heavy one might use 1% to 2%. Treat these as planning assumptions, not forecasts.
Solve for the contribution you need
The check also runs in reverse. Instead of asking whether the plan reaches the target, ask what contribution reaches it exactly. Rearranging the closed-form formula gives:
def required_contribution(balance, target, real_return, years):
"""Yearly end-of-year contribution that makes the balance equal the target."""
if real_return == 0:
return (target - balance) / years
growth = (1 + real_return) ** years
annuity_factor = (growth - 1) / real_return
return (target - balance * growth) / annuity_factor
for real_return in (0.03, 0.05, 0.07):
needed = required_contribution(100_000, 900_000, real_return, 25)
print(f"{real_return:.0%}: save {needed:,.0f} per year")This prints about 18,940 at 3%, about 11,740 at 5%, and about 5,650 at 7%. A result of zero or less means the existing balance alone reaches the target. The function does not clamp negative values, so read them as "no contribution needed".
The required contribution at 3% is more than three times the one at 7%. When the return assumption is uncertain, the contribution is the lever you control directly.
What the simple projection leaves out
The loop is deliberately plain. These are the common ways it misleads.
- Fees. An annual fund fee of 0.5% reduces the real return by about 0.5 percentage points. Use returns net of fees.
- Taxes. The target nest egg may be pre-tax, so a projection of a tax-deferred account is not directly comparable to an after-tax need. Apply the same tax treatment on both sides.
- Contribution changes. Salary growth, career breaks, and a mortgage ending all change the real contribution. Model them as separate phases instead of one constant.
- Timing. The loop stops at the retirement date. If you retire at 60 but a pension starts at 67, the gap years need their own funding.
- Averages hide volatility. A constant 5% is not what markets deliver. Two paths with the same average return can end very differently, especially when a bad year lands near retirement. The sequence-of-returns and Monte Carlo chapters cover this.
- Ignoring existing accounts. Add every account that is earmarked for retirement, but do not count your home or an emergency fund unless you plan to draw on them.
A repeatable procedure
- Write down the target nest egg in today's dollars and the years until retirement.
- Total the balances of accounts earmarked for retirement.
- Choose a real return net of fees. Use a base case and a pessimistic case.
- Set the annual contribution in today's dollars.
- Run the projection and compare it with the target.
- If it misses, compute the required contribution and decide which lever to change.
- Save the inputs and the date so you can rerun the check later.
Exercise
You have 50,000 saved, plan to add 8,000 per year (in today's dollars) for 20 years, and expect a 4% real return, with contributions made at each year end. Your target is 500,000. Use project_savings to find whether you reach it, and give the projected balance to the nearest thousand.
Show answer
Run projectsavings(50000, 8_000, 0.04, 20). The starting balance grows to 50,000 1.04^20, which is about 109,600. The contributions grow to 8,000 ((1.04^20 - 1) / 0.04), which is about 238,200. The total is about 347,800, so about 348,000. That is below the 500,000 target, so you miss it by roughly 152,000.
Exercise
Why is subtracting inflation from a nominal return only an approximation of the real return? Give the exact real return for a 6% nominal return and 2% inflation.
Show answer
Prices and returns compound together, so the exact relation is (1 + nominal) / (1 + inflation) - 1, not nominal minus inflation. For 6% and 2% it is 1.06 / 1.02 - 1, which is about 3.92%, slightly lower than the 4% from simple subtraction.