# Retirement planner: methods and limits

Research preview, 2026-11-28. No claim of investment suitability, profitable trading, model superiority, or calibrated decades-long success probabilities.

## Inputs and cash flows

Starting age, retirement age, end age, invested amount, annual contributions until retirement, annual retirement withdrawals, SPY stock weight (remainder TLT long-duration Treasury exposure), constant annual inflation assumption, and an optional one-time loss imposed at retirement. TLT is not a broad bond-market portfolio.

Every simulated month before retirement: apply the portfolio return, then add one twelfth of annual contributions. From the retirement month onward: apply the optional loss once, check and deduct one twelfth of annual spending at the start of the month, then apply returns. Failure means a required withdrawal cannot be covered. If that happens, wealth stays zero; future withdrawals are not treated as covered. An exactly funded final withdrawal counts as covered even if terminal wealth is zero. Success means all planned withdrawals can be covered under these conventions.

All cash flows and displayed wealth use today's dollars. Both contributions and spending are fixed in real terms. The user-selected constant inflation rate deflates every historical monthly nominal return. This is not a reconstruction from historical CPI or an inflation forecast. No taxes, trading fees, healthcare shocks, pension income, Social Security, salary uncertainty, spending changes or mortality model are included.

## Data and portfolio construction

Frozen revised Yahoo adjusted ETF price snapshots, daily SPY and TLT returns from 2005 through 2025. Weighted daily simple returns imply daily rebalancing. Monthly portfolio log returns are sums of daily weighted log returns, then subtract log(1 + annual inflation)/12. Both edge months are discarded because a dataset may begin or end partway through a month. The current snapshot produces 250 months from February 2005 through November 2025. No live data, no pretended 1970 history, no point-in-time vintage, no audited total-return or commercial-data-license claim.

Projecting decades from about 21 years of US ETF history is a strong assumption. Structural changes, extreme events not observed in the snapshot, and different inflation paths are not represented adequately. Long-horizon success rates remain illustrative.

## Three models

1. Historical resampling: circular 12-month contiguous blocks sampled with replacement. Use 8,000 simulated futures. Preserves within-block order but introduces artificial joins and a wrap-around boundary. Parameters and the empirical return distribution are treated as fixed; no posterior probability range is claimed.
2. Bayesian monthly Gaussian log returns: independent Normal(mu, sigma squared) observations. Priors: mu ~ Normal(0, 0.02 squared); log sigma ~ Normal(log(0.04), 0.7 squared), truncated to sigma in [0.001, 0.3]. Four Gibbs/Metropolis chains with 1,000 warmup and 2,000 retained draws each. Mean is sampled conditionally; log-scale Metropolis proposals adapt only in warmup. Sampling fails closed unless classical split-Rhat <= 1.01 and bulk and indicator-tail ESS >= 400 for both parameters. These are not rank-normalized Stan diagnostics. Bounded volatility keeps model expected wealth finite; prior and model choices materially affect results.
3. Exploratory fixed two-state Gaussian hidden Markov model: fit by 100 iterations of regularized forward-backward EM. Initialize both means at the historical mean, variances at 0.35 and 2 times empirical variance, and transitions at [[0.94,0.06],[0.18,0.82]]. Variance floor 0.000001. Transition pseudo-counts are 8 for staying and 1 for switching. Start simulations in the fitted stationary distribution. Gaussian state means, variances and transition probabilities are point estimates. Fixed initialization and finite optimization can produce a local solution. This is neither a sticky HDP-HMM nor a jump-diffusion model, and includes no posterior uncertainty in regime parameters.

The Bayesian model simulates 200 stratified posterior parameter settings with 100 independent futures each (20,000 paths). Its reported 5th–95th percentiles of conditional success estimates form an approximate parameter-sensitivity range, contaminated by inner simulation noise. Each conditional Monte Carlo standard error is at most 5 percentage points. Posterior draws are sorted by mean, then one joint parameter draw is sampled uniformly within each equal-sized stratum, preserving the empirical joint posterior while reducing Monte Carlo noise in the overall success estimate. The range excludes uncertainty about model choice, data quality, inflation assumptions and unknown structural changes. It should not be called a certified confidence interval or a precisely computed posterior interval for success probability. Repeated futures share parameter draws, so a naive binomial standard error over all paths does not measure total Monte Carlo uncertainty in the posterior-integrated success rate.

Fan-chart quantiles are pointwise 5/25/50/75/95 percentiles; they are not a simultaneous path envelope. Failure-age bars divide first failures by all paths, not just failed paths. All random seeds are fixed for reproducible comparisons. Optional retirement shocks are user-imposed portfolio losses; they do not estimate the probability of a war, crisis, or regime transition.

## Evidence

`tests/check_retirement.mjs` checks exact zero-return cash-flow examples, withdrawal timing, failure accounting, allocation and age validation, inflation conversion, state-transition normalization, wealth quantile ordering, posterior diagnostics, reproducibility and monotonicity under higher spending or a larger retirement shock using common random numbers.

`experiments/benchmark_retirement.mjs` compares one-month 90% return intervals at 23 monthly origins in 2024–2025, fitting exclusively earlier months each time. Revised historical prices and retrospectively chosen model settings prevent treating this as a pristine prospective test. These one-month checks do not validate multi-decade withdrawal success. The historical baseline has the lowest average interval score in this small exercise. Full results: `retirement_benchmark.md` and `reports/retirement_benchmark.json`.

Next evidence needed: broader licensed return histories, multiple allocations, long-horizon historical withdrawal replays with overlapping-sample dependence addressed, sensitivity to priors and model structure, and a genuinely prospective forecasting protocol. User interviews and comprehension testing have not yet been completed.

## Access and privacy

Public preview requires no account and stores no plans on a server. Inputs are used only by a browser Web Worker. The host receives normal web requests; the existing live-data API contacts its data provider. Email registration, saved plans and billing are not enabled. Public access does not expose archive-writing credentials; archive writes continue to require owner and operator authentication.

## Context for choosing assumptions

The inputs include a fixed, dated Federal Reserve reference: September 16, 2026 median projections for PCE inflation of 2.3% in 2027 and 2% in the longer run. Source: https://www.federalreserve.gov/monetarypolicy/fomcprojtabl20260916.htm. This is not a personalized cost-of-living forecast, is not a live update, and is not used as a time-varying inflation path. Choosing either number still applies one constant rate to the entire simulation. A 5% inflation button and 10/20/30% extra-drop buttons are illustrative stress assumptions, not estimated event probabilities.

The historical context recomputes weighted daily simple returns for the selected SPY/TLT allocation. Both edge months are discarded as in the planner. Monthly losses compound all daily returns in each remaining calendar month. Peak-to-trough drawdown uses the same remaining daily return sequence, initialized at wealth one and updated relative to its running maximum. These are nominal losses from revised adjusted-return proxies, before fees and taxes. Threshold counts use months with returns no greater than minus the selected loss, with a numerical tolerance of 1e-12. They are descriptive counts over dependent historical observations, not estimates of the probability of a crash at retirement. Allocation changes recompute all statistics; inflation and spending changes do not alter these nominal historical facts.
