liveBook · Manning

Longevity risk

As explained in Build a Robo-Advisor with Python (From Scratch)

Longevity risk is the risk of living longer than expected and exhausting financial resources during one's lifetime.

Longevity risk is the chance of surviving beyond expected life and exhausting assets. It matters because fixed-horizon retirement projections can miss the possibility of living longer. Lifetime payments from Social Security, defined-benefit pensions, and annuities reduce this risk by continuing for life. section 1.3 section 5.10

Model it by replacing a fixed retirement horizon with age-specific mortality probabilities. In each simulated year, test first for bankruptcy and then draw a random number against that year’s mortality probability; stop the path at death or bankruptcy. Mortality-table choice is an assumption: pension-annuitant data may understate mortality because annuity takers can have longer life expectancies. section 5.10

Listing 5.13 Simulating paths of wealth using mortality tables
np.random.seed(123)
num_years = 50
num_sims = 10000
mean = 0.06
stdev = 0.12
spending_0 = 60000
W0 = 1200000
age_start = 60  #1

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

age_bankruptcy = []  #2

for sim in range(num_sims):
    spending = spending_0
    year = 0
    alive = True
    bankrupt = False
    while not bankrupt and alive:  #3
        if W[sim, year] - spending < 0:   #4
            age_bankruptcy.append(year+age_start)   #4
            bankrupt = True  #4
        else:  #5
            mortality_prob = mort['Healthy Annuitant'].loc[year+age_start]  #6
            p = np.random.uniform()  #7
            if p < mortality_prob:  #5
                alive = False   #5
            else:   #5
                year += 1  #5
                W[sim,year] = (W[sim, year-1] - spending) * (1 + ret[sim, year])  #5
            spending = spending * (1 + inflation)  #5
    
bins = max(age_bankruptcy) - min(age_bankruptcy) + 1
plt.xlabel('Age')
plt.ylabel('Probability')
plt.hist(age_bankruptcy, bins=bins, density=True);

This simulation changes a 30-year loop into a path that ends only when the retiree dies or runs out of money, recording bankruptcy age when it occurs. section 5.10

Claim at 62 or wait until 70?

For a 62-year-old, waiting until 70 raises Social Security payments by 76%. A break-even calculation based on roughly age 84 can make the choice look close: delayed claiming has only about $3,000 more present value. Incorporating uncertain death through a lifecycle utility model instead produces materially higher utility for claiming at 70; at relative risk aversion 3, its certainty-equivalent benefit is about $35,000. section 6.4 section 1.3

Use longevity-aware analysis for decisions involving lifetime income:

  • Compare Social Security claiming ages beyond a break-even age. section 6.4
  • Assess a lump-sum pension payout against an annuity. section 6.6
  • Simultaneously optimize spending and asset allocation with reinforcement learning and mortality tables. section 6.6

How Build a Robo-Advisor with Python (From Scratch) covers it

How deep it goes
Implements mortality-table Monte Carlo paths and compares lifecycle utility, while noting mortality-data selection assumptions.
Examples
Uses a male retiree simulated from age 60 and a 62-versus-70 Social Security claiming comparison.
What it assumes
Uses publicly available mortality data and pandas DataFrames, then adds annual mortality draws to an existing wealth simulation.
What you can do after
Evaluate/understand how lifespan uncertainty changes retirement ruin estimates and the value of lifetime-payment choices.
How it connects
Connects retirement planning with Social Security, annuities, defined-benefit pensions, mortality tables, Monte Carlo simulation, utility functions, and reinforcement learning.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Robo-Advisor with Python (From Scratch). The section links point to the parts of the book it draws on.