Back to Documentation

Monte Carlo Simulation

10,000+ portfolio longevity trials sampling from historical equity and bond return distributions to quantify your probability of outliving your money.

How It Works

Monte Carlo simulation is the gold standard for retirement portfolio analysis because it captures the uncertainty inherent in market returns. Instead of assuming a single average return (which dramatically overstates outcomes due to sequence-of-returns risk), we simulate thousands of possible futures and measure how often the portfolio survives.

Return Distributions

We sample returns from historical data sourced through FRED (Federal Reserve Economic Data):

  • Equities: S&P 500 total return index (1926--present), modeled as a log-normal distribution with annual mean ~10.3% and standard deviation ~19.8%
  • Bonds: 10-Year Treasury constant maturity rate (1953--present), with mean ~5.8% and standard deviation ~8.2%
  • TIPS: Treasury Inflation-Protected Securities (1997--present), real return with mean ~2.1% and standard deviation ~6.4%
  • Inflation: CPI-U (1913--present), used to deflate nominal returns and adjust withdrawal amounts

Bootstrap vs. Parametric Sampling

Lontevis supports two sampling modes. The default is bootstrap sampling, which draws full-year return vectors (equity + bond + inflation together) from the historical record. This preserves the real-world correlation structure between asset classes and inflation -- for example, the fact that equities and bonds often move in opposite directions during flight-to-quality events.

The alternative is parametric sampling, which draws from fitted log-normal distributions with a user-specified correlation matrix. This allows you to stress-test scenarios that never occurred historically, such as a decade of simultaneous equity and bond losses.

Trial Mechanics

Each of the 10,000+ trials proceeds year by year from the retirement start date through age 100 (or a user-specified horizon):

  1. Draw a return vector for the year (equity, bond, inflation)
  2. Apply portfolio returns based on the current asset allocation (which may follow a glide path)
  3. Subtract the annual withdrawal amount, adjusted for inflation
  4. Add any Social Security income, pension payments, or annuity income for the year
  5. Apply Required Minimum Distributions if the retiree has reached the applicable age
  6. If the portfolio balance reaches zero, the trial is marked as "depleted"

Output Metrics

The simulation produces the following outputs:

  • Ruin probability: The percentage of trials where the portfolio is exhausted before the end of the planning horizon. A ruin probability below 5% is generally considered safe.
  • Safe withdrawal rate (SWR): The maximum inflation-adjusted withdrawal rate that keeps ruin probability below 5%. This is found via binary search across withdrawal rates.
  • Median portfolio at horizon: The 50th-percentile remaining portfolio balance, representing the expected bequest or cushion.
  • Confidence intervals: 10th, 25th, 50th, 75th, and 90th percentile portfolio paths over time, displayed as a fan chart.
  • Sequence risk score: A measure of how sensitive the outcome is to early-retirement returns, computed as the ratio of 10th-percentile to 50th-percentile outcomes in the first 5 years.

Sensitivity to Inputs

The simulation is most sensitive to three inputs: the initial withdrawal rate, the equity allocation, and the planning horizon. A 0.5% change in withdrawal rate can shift ruin probability by 10--15 percentage points. Equity allocations below 40% increase bond-dominated risk (purchasing power erosion), while allocations above 80% increase sequence-of-returns risk.

API Endpoint

POST/v1/monte-carlo

Run a Monte Carlo portfolio longevity simulation with your retirement parameters.

curl -X POST https://api.lontevis.smarttechinvest.com/v1/monte-carlo \
  -H "X-API-Key: lon_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "current_age": 62,
    "retirement_age": 65,
    "portfolio_value": 1200000,
    "annual_withdrawal": 48000,
    "equity_pct": 60,
    "bond_pct": 35,
    "tips_pct": 5,
    "ss_monthly": 2800,
    "ss_start_age": 67,
    "planning_horizon": 95,
    "trials": 10000,
    "sampling": "bootstrap"
  }'

Response Fields

  • ruin_probability -- fraction of trials where portfolio was depleted
  • safe_withdrawal_rate -- maximum SWR at 5% ruin threshold
  • median_portfolio_at_horizon -- 50th percentile remaining balance
  • percentile_paths -- year-by-year portfolio balances at p10/p25/p50/p75/p90
  • depletion_age_distribution -- histogram of ages at which portfolio hits zero (for depleted trials only)