Skip to content

Instantly share code, notes, and snippets.

@domenic
Last active August 29, 2015 14:20
Show Gist options
  • Save domenic/05d7a48193c85edf6b31 to your computer and use it in GitHub Desktop.
Save domenic/05d7a48193c85edf6b31 to your computer and use it in GitHub Desktop.
Emergency fund model

Inputs (defaults in parens):

  • F = An investment fund (SPX, or 70/30 split, or, ...)
  • Y = years until retirement (40)
  • S = starting year when you make the decision between strategies. At least Y years in the past since we want to draw on historical data. (now - Y)
  • T = total starting capital. This should be the amount of accumulated lifetime savings you have in non-retirement accounts, and you need to decide what strategy to use on it. ($100K)
  • E = emergency fund value. Sources suggest 3-6 months living expenses. ($20K)
  • P = probability that you need to access $E in an emergency, some time between S and S+Y. (10%???)
  • X = the year you need access to $E, in P*100% of universes (see below)
  • strategy = { invest, emergency fund }
  • invest = put all of T into F
  • emergency fund = put (T - E) into F, and keep E as cash.

Outputs:

  • Graphs (one per strategy) showing total income over time in the (1 - P) case.
  • Graphs (one per strategy) showing total income over time in the P case.
  • X should be an easily adjustable input, as it will drastically affect the result.
    • Highlight the worst-case Xs (for each strategy? or just for the invest strategy?). Cases where you had to withdraw but the market crashed so hard you couldn't even get $E dollars, or cases where you withdrew at the worst time and crippled total future earnings.

Extras:

  • What if emergency fund is not cash, but instead e.g. a CD ladder or a "high-yield" savings account? Assume that you shuffle off interest into your retirement account for greater gains? But see below.
  • What about inflation? Probably should normalize everything to S+Y dollars? That will show the emergency fund going down in value over time; should we allow a strategy that rebalances the emergency fund to keep pace with inflation?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment