Monte Carlo simulation estimates a range of financial outcomes by generating and analyzing many random scenarios. Rather than treating retirement wealth as a single straight-line projection, it produces a probability distribution, such as the chance that savings are exhausted within a chosen period. section 5.0 section 5.13
The method matters when withdrawals make the order of returns consequential. A $100,000 portfolio that doubles and then loses half ends at $100,000 regardless of order when untouched. With a $50,000 withdrawal after year one, the gain-then-loss path ends at $75,000, while the loss-then-gain path reaches zero. section 5.0
A retirement simulation defines assumptions, samples returns, evolves wealth along each path, and counts failures. A simple annual model begins with $1,200,000, spends $60,000 initially, raises spending 2% for inflation, and samples annual portfolio returns with 6% mean and 12% standard deviation. It assumes a fixed stock-bond mix, yearly rebalancing, no income, and no withdrawal taxes. section 5.5
Listing 5.4 Simulating paths of wealth
np.random.seed(123)
num_years = 30
num_sims = 10000
mean = 0.06
stdev = 0.12
spending_0 = 60000
W0 = 1200000
inflation = 0.02
ret = np.random.normal(loc=mean, scale=stdev, size=(num_sims, num_years+1))
W = np.empty(shape=[num_sims, num_years+1])
W[:,:] = np.NaN
W[:,0] = W0 #1
count_bankrupt = 0 #2
for sim in range(num_sims):
spending = spending_0
for year in range(1, num_years+1):
# Check whether you run out of money
next_period_wealth = (W[sim, year-1] - spending) * (1 + ret[sim, year]) #3
if next_period_wealth < 0:
count_bankrupt += 1
break
else:
W[sim, year] = next_period_wealth
spending = spending * (1 + inflation) #4
plt.xlabel('Year')
plt.ylabel('Wealth')
plt.plot(W[0:10,:].T); #5
This implementation stores one wealth path per row, subtracts spending before applying each sampled return, stops failed paths, and estimates bankruptcy probability from the failure count. section 5.5
Simulations can make the model more realistic by incorporating uncertain inputs and alternative modeling choices:
- Model inflation, health-care expenses, life expectancy, and future tax rates as random factors alongside investment returns. section 5.0
- Use arithmetic average returns as simulation inputs, distinguish them from geometric averages, and generate wealth paths over time. section 5.13
- Use an AR(1) process for inflation, generalized error distributions for short-period return fat tails, or bootstrapped historical returns to retain non-normality and cross-asset correlations. section 5.13
- Incorporate mortality tables when longevity risk affects the planning horizon. section 5.13
Results are estimates conditional on the assumptions, not guaranteed recommendations. The simple model deliberately omits taxes and income and uses annual periods; fuller planning can add joint Social Security decisions, survivor benefits, taxation, outside income, monthly calculations, and utility-based objectives that account for risk aversion. section 5.11 section 5.5
Estimating retirement failure risk
Generate 10,000 30-year annual wealth paths. For each path, increase spending with inflation, apply a sampled return, and mark bankruptcy when next-period wealth is negative. Dividing failed paths by all paths estimates the probability of running out of money; the illustrated base case produces a result close to 50%. section 5.5







