Feb 2, 2026

GPT Prompt01 - Spending Strategies

I slaved for 12 years in the mines of this blog, toiling night and day, for all three of my readers. My now ex gf during five of those years once accused me of loving retirement finance and my computer more than her ;-) something which I can neither confirm nor deny, then or now. 

Recently, just for fun and to see how it would go, I spent a couple hours recreating and recasting five or six of what I consider my sufficiently important or interesting coding projects into AI prompts <dramatic eye roll on all those wasted years>. I maybe should have waited for the advent of AI and saved myself at least some of those 11.999 years where I maybe didn't have to do anything. Or gone to a bar. Or traveled. Whatever, I thought I would share some of the prompts and projects here. To wit (each will be a separate post):

  • GPT Prompt 01 - Spending Strategy Comparisons [this post]
  • GPT Prompt 02 - Lifetime Probability of Ruin (LPR)
  • GPT Prompt 03 - Dynamic Programming / HJB
  • GPT Prompt 04 - Portfolio Longevity Heat Map
  • GPT Prompt 05 - Perfect Withdrawal Rate (PWR)
  • GPT Prompt 06 - Stochastic Present Value (SPV) 

Some caveats first:

- The prompting process seems unstable for each re-prompt and yields varying results and is also conditional on the platform. I used ChatGPT's $20/month platform "Plus." Fwiw, I also save a physical copy so that I can re-force AI to more or less start from scratch each time rather than trusting it to remember stuff. Note that I actually had to re-prompt this after not looking at it for 6 months because it literally did not work after it had worked 50 times the last time I worked on it. Beware. 

- AI's hallucinate and you have to take output carefully and/or with a grain of salt,

- Chat may evolve and obsolete the prompts,

- It helps to know the underlying theory and methods to second guess what it is doing. Otoh, one can have a dialogue now to figure it out, 

- There are certain tasks it will NOT do. For example, it said once that it could do HJB on 2-asset allocation optimization and then when I said "ok, now run it," it said "sorry, bro, can't; it's too hard and will time out." It later created an acceptable work around but one needs to know what it can and can't do. It probably just want's me to pay more,

- I did this more or less "seat of the pants" so there might be assumptions Chat used for me during the many iterations that won't be resident in memory for you if you test drive. No idea...

- These are fairly trimmed down and focus more on simple versions of the theory. No fine tuning for fees or taxes or investor idiosyncrasies etc but those are probably easy enough to retrofit,

- Rigorous testing against a previously coded model has NOT been done. I guarantee I have probably mis-prompted somewhere in here and I don't even know it. The adjustment I just made to mortality for this post I have not rationalized, I just trusted Chat because I somehow got in an infinite loop and didn't want to think too hard, yet,   

- This is titled "spending strategies" but is articulated below for comparing portfolios. It is trivial to swap to just one portfolio and use multiple spending strategies. Not shown. Maybe later. For the one of the three readers that care. 


GPT Prompt 01 - Spending Strategy Comparison 

Description

Rather than asking whether a retirement plan merely “avoids ruin,” this framework evaluates spending strategies by the lifetime well-being they actually deliver. Each candidate rule—fixed withdrawal rates, flexible rules, or utility-based spending—produces a stochastic path of real consumption over time, which is then evaluated using expected lifetime utility, weighting consumption by survival probabilities and (optionally) modest time discounting:

E ⁣[ttpxβtu(ct)],E\!\left[\sum_{t} {}_t p_x \,\beta^t\, u(c_t)\right],

where u()u(\cdot) is typically a CRRA utility function. Because raw utility is not directly interpretable, results are translated back into dollars via certainty-equivalent consumption: the constant real spending level that would yield the same lifetime utility. This approach captures the economic reality that early-life consumption, spending stability, and downside protection matter far more than late-life volatility or rare tail survival, and it frequently shows that conservative, floor-oriented spending policies can deliver higher lifetime welfare than mechanically “safe” withdrawal rules—even when those rules technically succeed.

[I let AI write the description so the narrative overview here pretty much sucks. Basically the model does a simulation to generate the expected discounted utility of lifetime consumption (EDULC) along a bunch of sim consumption paths. ie one may compare EDULC (or its certainty equivalents) for different portfolios or spending strategies and do some comparisons... Do you know or have you ever used MaxFi? This is the same thing except I am handing it out for free. Plus it is infinitely flexible...but way less sophisticated on things like taxes and social security and location buckets...but that'd be easy enough to fix I'd wager. This is my partial gift to you in other words because why pay for stuff we can get for free and especially when there are diminishing returns to marginal complexity ;-)]


The Prompt (which may or may not work anytime it is run)

You are an expert in retirement finance: portfolio theory, quantitative finance, financial economics (e.g., the Life Cycle Model and utility theory), actuarial methods and stochastic simulation.

Evaluate spending strategies under uncertainty using an economic consumption utility approach: “Expected Discounted (subjective time preference) Utility (CRRA) of Lifetime Consumption.”

Parameters:
- current_age: 65

Mortality model: Gompertz with modal age = 88, dispersion = 9; conditional on current_age; limit max age to 122 

Gompertz model is this conditioned on current age: S(a) = \exp\!\left(-\exp\!\left(\tfrac{a - m}{b}\right)\right) 

Precompute conditional survival and then sample once:
  Compute Pt​=tPx=S(x+t)/S(x) for t=0..T | x=current_age
  Convert to death CDF over t (probability death occurs in year t)
  Sample death year by inverse CDF (vectorized)

Portfolio model 1: 60/40 equity/bond with expected REAL forthcoming arithmetic return = 0.04, stdev = 0.12, annual rebalancing

Portfolio model 2: 100/0 equity-bond with expected REAL forthcoming arithmetic return = 0.06, stdev = 0.17, annual rebalancing

Portfolio model 3: 35/35/30 equity/bond/trend-following with expected REAL forthcoming arithmetic return 0.035, stdev 0.07, annual rebalancing

Returns: annual lognormal real gross returns calibrated to match stated arithmetic mean/stdev; annual rebalancing (single return per year)

Consumption model is, beginning at the start age, a constant real withdrawal of 5% of initial wealth

initial wealth is $1,000,000

- Utility function: CRRA with risk aversion γ = 2
- Subjective time preference discount rate: 0.5%
the utility function formula for CRRA:
U(c) = \frac{c^{1-\gamma} - 1}{1-\gamma}, \quad \gamma \neq 1
and log utility for γ=1
certainty-equivalent consumption is normalized by the discounted weights not by expected lifetime

Number of simulated lifetimes: 10,000

Additional assumptions:

- A guaranteed, inflation-adjusted income stream of $10,000 (in initial year(0) dollars) begins at age 70,

- Before age 70: if portfolio wealth depletes to less than $1, consumption falls to an inflation adjusted hard-life floor of $5,000 in year(0) dollars,

- At and after age 70: if portfolio wealth depletes, consumption immediately adjusts (“snaps”) to the guaranteed income stream.

In those periods where wealth and income are more than enough for the spending strategy the excess income should not add to the spending strategy but rather be reinvested.

No borrowing is allowed.

Strategies to test:

1. Portfolio model 1

2. Portfolio model 2

3. Portfolio model 3

Tasks:

1. Simulate outcomes for each strategy across random returns and random lifetimes.

2. Report:

a. Expected discounted utility of lifetime consumption

b. Certainty-equivalent constant consumption

c. Probability of ruin (wealth hits 0 before death)

d. Probability consumption < 20,000

e. Distribution of terminal wealth at death

3. Rank strategies by certainty-equivalent consumption.

4. Summarize tradeoffs between strategies.



Notes

If it won't run it, you might have to tell it to "Run this as a reproducible Monte Carlo now."

This sometimes takes a while. No doubt there are ways to speed this up

Follow-on analysis and charting and changes are fairly straight forward (not shown)

Sensitivity analysis for different spend rates? just ask. Guardrails? prompt


Output Example (when the prompt actually works)















Ranking by certainty-equivalent consumption

  1. Portfolio 3 (35/35/30 + trend): $48,918

  2. Portfolio 1 (60/40): $46,266

  3. Portfolio 2 (100% equity): $45,806

Tradeoffs (what’s going on) 

  • Portfolio 3 dominates in welfare because its lower volatility sharply reduces the chance of ever dropping into the “bad regime” where consumption snaps down to $10k (age 70+) or $5k (pre-70)—both below the $20k threshold and heavily penalized by CRRA (γ=2).

  • Portfolio 2 throws off the biggest estates (huge right tail: P99 ≈ $11.2M), but under γ=2 that upside doesn’t compensate for the occasional bad sequence that forces low consumption; hence lower CE even with higher mean returns.

  • Portfolio 1 is the middle policy: less upside than 100% equity, more downside protection than 100% equity, but still not as protective (in this run) as the low-vol “trend” mix.



No comments:

Post a Comment