Can I afford to retire?

I’m taking some years off of work, and it’s entirely uncertain whether I’ll ever return to the kind of full-time gigs that I’ve held in the past. With that in mind, I found myself asking myself: can I afford this?

Most people, asking that question, would seek a financial advisor. Some people follow simple rules, like “withdraw 4% of your portfolio every year”. There are tools out there that will show you nice charts illustrating the possibilities; some of them are free, and others charge a moderate amount.

None of these options felt like they brought a suitably “real” understanding of the world to me. I wanted to gauge the likely outcomes of a retirement that could last more than 60 years, and I wanted to do it based on real-world understanding of how markets function, not a heuristic developed based on 20th century American history and explicitly tied to 30-year retirement periods.

A “Game of Life”

With that in mind, I built a Monte Carlo simulation of my life. It ends up looking like a “game of life”, where each “turn” is a year of my future. Every year proceeds as the interaction of three models:

  1. the world model generates “what the world throws at you” based on random distributions: mortality, non-mortal “frailty” (on an arbitrary scale from 0 to 100%), marriage, divorce, unexpected needs (e.g. family needs help, car broke down), job opportunities (or lack thereof), taxes, Social Security payments (or lack thereof), etc.
  2. the capital markets model sits as a plugin within the world model. It produces a return on every type of investment that I might own, drawn randomly from a distribution calibrated to match historical expectations. It also draws other figures, such as changes in broad consumer prices and sector-specific consumer prices (e.g. healthcare, shelter).
  3. the me model (MM) owns a set of assets (e.g. stocks, bonds, real estate), and can buy/sell/rebalance them. It has a baseline set of needs, and a set of categories that it enjoys spending money on, many of which are conditional. For instance, it enjoys spending money on snowboarding, but its enjoyment fades when the world model hands it a frailty score above 0.15, and reaches 0 when frailty is above 0.30.

As with all Monte Carlo simulations, the idea is to randomly generate many different paths that could represent the future, and see how much enjoyment the MM gets from each one. Each path is generated from a fixed random seed, so any path can be replayed exactly: it’s possible to go back and see what drove the utility upward or downward on each path. I’ve tried to justify each of the statistical assumptions from something with demonstrable validity. Expected lifetime is disciplined by actuarial tables published by the Social Security Administration, and then intentionally biased upward by public health studies on the effects of income on mortality. Market returns are anchored to the Jordà-Schularick-Taylor (JST) Macrohistory Database, which covers 18 advanced economies since 1870: my hope is that a model disciplined to this dataset will be significantly more realistic than one that came solely from American 20th century returns.

What makes me happy?

As you might expect, the MM’s “utility” is nonlinear: $1 spent to supply a basic need like food or healthcare is worth more than $1 spent on clothing, which is worth more than $1 spent on travel. Specifically, my enjoyment is modeled as a Stone-Geary utility function. This shape provides steep penalties for falling beneath a subsistence floor, but they are finite: infinite disutility from falling beneath the floor would produce a model that is mortally afraid of spending a single dollar more than it is ever forced to, which is no way to live.

In addition to parameters that are calibrated to economic data, the model has a few parameters that are elicited based on my understanding of myself. These are things like:

  1. risk preference/aversion: after your basic needs are met, how much do you prefer a sure-thing payoff over a conditional one?
  2. destitution penalty: how many years of comfort would you give up, in order to avoid one year spent destitute?
  3. satiation ceiling: is there any amount of annual spending past which you feel life couldn’t get much better?
  4. bequest utility: how much more/less do you value giving to others when you die, relative to spending while you’re alive?
  5. want arrival: how quickly do new avocations come along, how much do they cost, and how quickly do they fade?
  6. obligation arrival: how likely is it that you’ll need to fund a major expense within the next X years? What is its approximate magnitude? How much utility would it cost if you couldn’t fund that expense when it arrived?
  7. relative utility: if your portfolio is down 30%, how much better do you feel if you know that your neighbors are down 50%? In other words, if the US economy absolutely tanks, is it necessary to ride it out unscathed, or do you just want to “keep up with the Joneses”.

There are also various elicited conditional events, like “I think that if I own a house, I’ll want to do major work on it (beyond basic upkeep) for $X every Y years”. Behaviorally, the model assumes that I am capable of executing on its recommendations. It doesn’t include the possibility of “what if I develop a terrible addiction that saps my money and decision-making capacity simultaneously”, because no financial model can ever solve for such things, and the menu of possible ways to mess up one’s life is longer and more varied than any one model could ever represent.

I opted not to encode any time-preference into the model: there’s no parameter that makes a dollar at age 40 worth more than a dollar at age 70. But time-preference develops naturally from other sources, like mortality: dead MMs have zero future utility, so the optimizer has some natural pressure to live life now, rather than hoping to live a bigger/better life in the future.

In general I tried to get the utility function calibrated without allowing the model to value money-for-money’s sake. This was somewhat difficult, and early versions of the MM had some perverse incentives. For instance at one point I granted amenity value to owning a nicer home, and didn’t really give the MM any other ideas for how to spend unbounded quantities of money. The natural result was that the MM chose “buy ALL the homes”. Perhaps I should have given it an affinity for paperclips instead…

In practice the utility function ended up being a bit of a cop-out: instead of allowing the model to value money for money’s sake, I gave it the “want arrival” and “obligation arrival” mechanics that are discussed above. With these in place, the optimizer would have a reasonable expectation of “if I don’t spend it on X, there’ll be another Y that I can spend it on”, which might be effectively the same thing as valuing money for money’s sake.

Optimizing

Given all of these hazards and preferences, the job of the optimizer is to find a strategy for the MM to follow while navigating the uncharted waters that constitute my future. These decisions include:

  1. how much of my portfolio should be stocks, as opposed to bonds? Should my stock allocation follow a glidepath, or stay constant over my lifetime?
  2. should I prefer to invest in stock markets with lower valuations, as measured by an index like cyclically-adjusted price-to-earnings (CAPE)?
  3. how big of a home should I buy? when?
  4. should I use a mortgage to fund my home purchase? Should I take out just enough debt to maximize my tax benefit, or go further?
  5. should I buy annuities? How much? At what age? Can/should I use my knowledge of my own health to size my annuity purchase?
  6. at what level of destitution should I start looking for a job? Should it be for minimal subsistence and healthcare premiums (i.e. a benefits job), a return to my former life of full-time employment, or a consulting gig?
  7. when should I claim Social Security?
  8. how much should I adjust my spending upwards (or downwards) in fat (or lean) years?
  9. how aggressively should I convert my traditional retirement assets to Roth?

The optimizer is a piece of software with a pretty simple goal: given everything it knows about my utility function and available choices, find the “right” strategy for me to follow. It does this by the age-old technique of “just simulate a bunch of possibilities, and see which ones come out on top”. There are numerous statistical techniques that tie in here, largely for answering questions like:

  1. if I see one strategy beating another, how can I be certain that it isn’t noise from statistical sampling?
  2. if two strategies interact in some way, how do I make sure that I find their joint optimum?

These will be pretty familiar to anyone with a machine learning background. In fact, my guess is that modern coding LLMs—having been designed to facilitate machine learning SWE workflows—were unusually useful in building this optimizer as well.

Decision Support

Naturally, there are two pathologies inherent in retirement planning:

  1. spending outruns your nest egg, and you are left destitute
  2. fear #1 leads you to hoard wealth, so you sit on your nest egg and refuse to spend a dime

To me, the purpose of the “robo-advisor” I have built is to chart a course between the two extremes, so that I can confidently budget how much to spend in a given year. The budget also informs whether I should be getting a job, and (upstream of that) how carefully I should steward my human capital. If I start to feel constrained by the budget my advisor has given me, that means that I should probably think about putting my “retirement” on hold for a while.

The simulator can also be used as a what-if tool. For instance: right now it says that I’d be much better off economically if I continue renting my primary residence. But since I want to buy anyway, I can ask “just how disastrous of a decision is it?”, and then use the simulated answer to determine whether the satisfaction and security of owning is worth a loss of $X/year of spending. It’s also been pretty helpful to learn that certain decisions are basically a wash in my specific situation, like what year I should start claiming Social Security.

Modeling capital markets…accurately

The model of capital markets I went with does match history on most statistical measures, but isn’t directly sampled from the past (i.e. it is not a bootstrap resampling method). Instead the market model has a hidden “regime” parameter that can transition stochastically between four regimes: normal, crisis, stagflation, and repression. Each regime has its own statistical distribution for the return of capital assets over that year. This is a “regime switching” model, and each regime is calibrated against the historical dataset to ensure that there is no significant divergence.

Interestingly, in the initial version of the model (after calibration) there were some simulated life paths that produced preposterous results, like 65 years of uninterrupted 19% real returns, which (by implication) would result in me owning a significant portion of world economic output. This seemed unrealistic, so I added a parameter that disciplines truly runaway scenarios to an estimate based on:

  1. what is the likelihood of an X% rise in GDP?
  2. how much of that growth is going to transmit into post-dilution corporate earnings?
  3. what forward P/E ratio can a national or supranational market reasonably inhabit?

Should I go all-equity?

No, apparently. My optimized result was an essentially-flat band from 70-90% equity, with 80% being slightly preferred. This differs from some other results that advise 100% equity. Initially I thought that this was because I had given the optimizer unexpected “lumpy” expenditure arrivals at non-trivial percentages of my net worth. In other words, a big expense might always be on the short-term horizon, so the optimizer preferred bonds. But a test with the lumps removed only moved the dial slightly towards equity, in a manner barely above noise.

In my model, I was able to make the optimizer prefer an all-equity portfolio only in cases where:

  1. my yearly consumption never satiates, and
  2. I have a substantial bequest motive

Either tweak alone still left the optimizer preferring to allocate at least 10% to bonds.

Conclusion

My “advisor” has given me a pretty clear picture of how much I can spend, the likelihood of ending up destitute, and whether I will ever need to go back to work for income (rather than for the love of the game). Interestingly, the dial that controls eagerness to go back to work doesn’t really affect my odds of ending up broke. Whether the model starts looking for a job when income coverage dips below 80% of my floor or 150%—a difference between working on 10% of simulated lives and 40% of them—the fraction that end in destitution is the same to within the noise. What changes is how well the rest of them live.

The paths that end badly are mostly paths where the world model made work unavailable: I’m too old to be rehired, too sick, the job market is frozen in exactly the crash year I need it, or I died. A more eager job search can’t reach those. What it reaches is the ordinary bad-but-survivable stretch, where a couple of years of income means not selling stocks at the bottom.

Epilogue

At one point I built a browser over simulated life-paths, so that I could calibrate whether each life-path represented a realistic draw: one keybinding would advance a year along a given path, and another keybinding would switch to a new life-path. One thing that struck me was just how fat the tails were, in every sense. Numerous simulations end with the MM overly rich, and wishing he had spent more liberally during his life. A good number end up destitute. There are more than a few centenarians.

But the most memorable one was the fourth life-path I saw: he dies without warning three years from now. The visualization elicited an “aww, poor guy” from me when it popped up on my screen, and gave me a bit of a doleful feeling. Life is for the living, I suppose.