Author Topic: Cash vs Stocks - Risk Tolerance and Timeframes  (Read 5133 times)

maizefolk

  • Walrus Stache
  • *******
  • Posts: 7400
Cash vs Stocks - Risk Tolerance and Timeframes
« on: May 30, 2016, 07:13:47 PM »
Everyone on this board will be familiar with the advice that you should never put money you're likely to need in the next couple of years (for example a house downpayment) into the stock market. We're also familiar with the idea that letting money that's going towards funding your FIRE sit around in a savings account is a recipe for working years longer than necessary.

I wanted to locate the split in timeframes that separates these two opposite pieces of investing advice. So I used a frankly beautiful dataset of monthly stock market prices and dividend yields going back to 1870 (https://github.com/datasets/s-and-p-500), sampled 1000 random start months to invest, and ran out each simulation for twenty years comparing the value of $100,000 invested in the stock market to $100,000 left in a bank account.



  • If you can tolerate a 10% risk of being worse off than leaving your money in the bank, put your savings into stocks for any time frame greater than or equal to ~6 years.
  • If you can tolerate a 5% risk of being worse off than leaving your money in the bank, put your savings into stocks for any time frame greater than or equal to ~8 years.
  • If you cannot tolerate a risk of even 1% that you'll end up behind where you'd be if you left your money in the bank, then for any money you'll need back in less than almost 16 years shouldn't go into the stock market.

This is a pretty basic analysis, so apologies if I'm duplicating information someone else has already posted, but I wasn't able to find any in my cursory googling that provided a graphical display of how differences in risk tolerance influence when the advice switches from "save in cash" to "invest in the market" so I'm posting my own results here.

In the words of Tom Lehrer: "This may prove useful to some of you someday perhaps in a somewhat bizarre set of circumstances...."

capoevename

  • 5 O'Clock Shadow
  • *
  • Posts: 49
Re: Cash vs Stocks - Risk Tolerance and Timeframes
« Reply #1 on: February 03, 2017, 03:16:05 PM »
Yes, this was useful. Thank you.

brooklynguy

  • Handlebar Stache
  • *****
  • Posts: 2204
  • Age: 43
Re: Cash vs Stocks - Risk Tolerance and Timeframes
« Reply #2 on: February 03, 2017, 03:58:24 PM »
Excellent work, corn-man (though I would have enjoyed this even more if you would have used your signature xkcd-style graphs).

But now I'm wondering how much the results would differ if you use actual historical cash returns (instead of a fixed 1%), given that stock market performance and interest rates are not uncorrelated.

maizefolk

  • Walrus Stache
  • *******
  • Posts: 7400
Re: Cash vs Stocks - Risk Tolerance and Timeframes
« Reply #3 on: February 03, 2017, 04:12:43 PM »
Thanks guys!

I'd completely forgotten about this old orphan post, so great to see it pop back up in Investor Alley.

Brooklynguy, it's been a while since I broke out the XKCD style, I should really find an excuse to do so again soon.

You're right it'd be much better to run this with historical interest rates. Although then I should really also factor in inflation instead of just correcting for it, since if inflation in 11%, you're making 12% interest, but paying regular income tax rates on your interest income, you'd end up way behind. I wonder if there is a good historical consumer banking interest rate dataset out there?

Indexer

  • Handlebar Stache
  • *****
  • Posts: 1463
Re: Cash vs Stocks - Risk Tolerance and Timeframes
« Reply #4 on: February 03, 2017, 06:49:19 PM »
Maizeman,

This is awesome! Thank you for running the numbers.

How hard would it to be them same math for stocks Vs bonds or bonds VS cash.

I know for the super short term cash is better, but I'm wondering if bonds are the better bet in the 3-7 year time frame.

mgarf

  • 5 O'Clock Shadow
  • *
  • Posts: 41
  • Location: Alberta
Re: Cash vs Stocks - Risk Tolerance and Timeframes
« Reply #5 on: February 04, 2017, 08:30:53 AM »
How hard would it to be them same math for stocks Vs bonds or bonds VS cash.

I know for the super short term cash is better, but I'm wondering if bonds are the better bet in the 3-7 year time frame.

I've done this analysis. Here it is for 5 years. 65% Bonds (short/intermediate), 35% Stocks is optimum here.



Click here for graphs for other timespans.

I've also built a simulator you can use to try different combos yourself.
« Last Edit: February 04, 2017, 08:37:00 AM by mgarf »

maizefolk

  • Walrus Stache
  • *******
  • Posts: 7400
Re: Cash vs Stocks - Risk Tolerance and Timeframes
« Reply #6 on: February 04, 2017, 08:34:54 AM »
The problem with bonds is the same one as with trying to use real consumer interest rates: getting data that goes back far enough, and data on a month by month basis.

Bonds vs my simplifying assumption for cash would just mean swapping out one of the input files. Bonds vs stocks would mean modifying some code, but wouldn't be too bad.

The best I've found so far is this series on the returns of the 10 year treasury bill going back to 1928. I think it's not inflation adjusted, but that's an easy fix. But it's only once per year, which isn't.

http://pages.stern.nyu.edu/~adamodar/New_Home_Page/datafile/histretSP.html

maizefolk

  • Walrus Stache
  • *******
  • Posts: 7400
Re: Cash vs Stocks - Risk Tolerance and Timeframes
« Reply #7 on: February 04, 2017, 01:45:00 PM »
Okay, here's something anyway. I used the 10 year government bond interest rates from Schillers data (although looking at the data I think there is an awful lot of imputation going on to get monthly interest rates at the beginning of his time series) and calculated monthly interest returns from the annual rates as (1+annual interest rate)^(1/12) - 1 and monthly appreciation (or loss) of bond value as previous_interest_rate/current_interest rate (so if interest rates doubles, the old bond would be worth half as much, while if the interest rate are cut in half, old bonds are worth twice as much). I'm not confident that second half is the correct way to do things, but it at least produces numbers that seem reasonable. (See comment from beltim below on the right way to calculate this.)

This lets me run three scenarios forward for every randomly selected start month. Putting $100k in the stock market, putting $100k in 10 year government bonds, or leaving $100k in the bank.



Of course the problem is no one, myself included, wants to look at 500 or 1000 of these plots. So in the figure below, I've recreated the top left panel from my original post for stocks, done the same for bonds, and then made a summary panel at the bottom that looks across all 500 simulations each month, and reports the odds that stocks outperformed both bonds and cash, that bonds outperformed stocks and cash, or that cash out performed bonds and stocks.


Now with the corrected bond returns. See the original version I posted here.

What's interesting to me is that in some ways this is a lot less useful result. If you can tolerate some uncertainty, stocks are still the most likely to produce the highest return at any point in the simulation. 10 year government bonds (assuming both that the underlying data is good and that my math has some bearing on reality, do a better job than cash, but it still takes about four years before there's no chance of cash outperforming both bonds and stocks.
« Last Edit: February 05, 2017, 03:27:06 PM by maizeman »

beltim

  • Magnum Stache
  • ******
  • Posts: 2957
Re: Cash vs Stocks - Risk Tolerance and Timeframes
« Reply #8 on: February 05, 2017, 08:27:13 AM »
Okay, here's something anyway. I used the 10 year government bond interest rates from Schillers data (although looking at the data I think there is an awful lot of imputation going on to get monthly interest rates at the beginning of his time series) and calculated monthly interest returns from the annual rates as (1+annual interest rate)^(1/12) - 1 and monthly appreciation (or loss) of bond value as previous_interest_rate/current_interest rate (so if interest rates doubles, the old bond would be worth half as much, while if the interest rate are cut in half, old bonds are worth twice as much). I'm not confident that second half is the correct way to do things, but it at least produces numbers that seem reasonable.

It's not accurate, but there's a relatively easy fix.  Since your data set is for a constant duration bond, you can approximate the profit or loss as duration*interest rate change (in percent).  So a 1% drop in interest rates would be roughly a drop in value of 10%.

But, since you're running this on a computer, you don't need to do the approximation.  You can figure out the drop in value directly from the interest rate:
New value = Old value * ((1 + new interest rate) / (1+old interest rate)) ^ maturity

maizefolk

  • Walrus Stache
  • *******
  • Posts: 7400
Re: Cash vs Stocks - Risk Tolerance and Timeframes
« Reply #9 on: February 05, 2017, 09:25:35 AM »
Since your data set is for a constant duration bond, you can approximate the profit or loss as duration*interest rate change (in percent).  So a 1% drop in interest rates would be roughly a drop in value of 10%.

But, since you're running this on a computer, you don't need to do the approximation.  You can figure out the drop in value directly from the interest rate:
New value = Old value * ((1 + new interest rate) / (1+old interest rate)) ^ maturity

Thanks beltim! Your formula makes much more sense.

Should the old and new interest rates be swapped, though? The direction of change is not what I would have expected. If I plug in a rise of interest rates from 5% to 6%, assuming a 10 year bond, the formula has value of the old 5% bond rises to 109.94, and if rates from from 5% to 4% the value of the old 5% bond falls (to 90.87). I was expecting the value of the bonds to move in the opposite direction from the change in interest rates. Alternatively it could be a bug in my code or I may be thinking about the value of bonds in the wrong way.

beltim

  • Magnum Stache
  • ******
  • Posts: 2957
Re: Cash vs Stocks - Risk Tolerance and Timeframes
« Reply #10 on: February 05, 2017, 12:23:53 PM »
Since your data set is for a constant duration bond, you can approximate the profit or loss as duration*interest rate change (in percent).  So a 1% drop in interest rates would be roughly a drop in value of 10%.

But, since you're running this on a computer, you don't need to do the approximation.  You can figure out the drop in value directly from the interest rate:
New value = Old value * ((1 + new interest rate) / (1+old interest rate)) ^ maturity

Thanks beltim! Your formula makes much more sense.

Should the old and new interest rates be swapped, though? The direction of change is not what I would have expected. If I plug in a rise of interest rates from 5% to 6%, assuming a 10 year bond, the formula has value of the old 5% bond rises to 109.94, and if rates from from 5% to 4% the value of the old 5% bond falls (to 90.87). I was expecting the value of the bonds to move in the opposite direction from the change in interest rates. Alternatively it could be a bug in my code or I may be thinking about the value of bonds in the wrong way.

Whoops, you're right.  I had it in an excel sheet to make sure and then switched new and old.  Yes, the price and interest rates move in opposite directions.

maizefolk

  • Walrus Stache
  • *******
  • Posts: 7400
Re: Cash vs Stocks - Risk Tolerance and Timeframes
« Reply #11 on: February 05, 2017, 03:29:29 PM »
Great! I've updated the figure using the bond price changes calculated with the new formula. The biggest change seems to be that this let bonds beat out cash a lot more frequently in the early years.

FrugalFisherman10

  • Bristles
  • ***
  • Posts: 390
    • Fly Fishing Photo Project
Re: Cash vs Stocks - Risk Tolerance and Timeframes
« Reply #12 on: February 07, 2017, 12:00:22 PM »
This is amazing.

Here's a question. Looking at the 15 year mark, and at the 10 percentile return for stocks, what is the likelihood that the same periods that make up the 10 percentile stock returns are 90 percentile "bond return periods"? This would have to do with how stocks and bonds are correlated to eachother I guess.

What I'm saying is, say you had a 15 year time frame where you invested in stocks, get to the end of it and realize "damn, the returns experienced during this time period were in the 10th percentile of stock returns (terrible)...ah well, at least bond returns weren't that great during this period either"...looks at second graph..."shoot! Bond returns were in the 90th percentile of all bond returns during this same period!"
And given the correlation between stocks and bonds, isn't that scenario fairly likely?
If you experience a 15 year period of stock returns in the 10th percentile, is it likely that bonds were returning in the 90th percentile?

stashgrower

  • Bristles
  • ***
  • Posts: 343
  • Location: Australia
Re: Cash vs Stocks - Risk Tolerance and Timeframes
« Reply #13 on: February 07, 2017, 03:49:43 PM »
Interesting. Thanks, maizeman, your calcs opened my eyes to the "real" risk of stocks vs cash.

josh4trunks

  • 5 O'Clock Shadow
  • *
  • Posts: 62
Re: Cash vs Stocks - Risk Tolerance and Timeframes
« Reply #14 on: February 07, 2017, 05:31:22 PM »
This is extremely helpful.

I love the dissection and simplicity in the approach.

maizefolk

  • Walrus Stache
  • *******
  • Posts: 7400
Re: Cash vs Stocks - Risk Tolerance and Timeframes
« Reply #15 on: February 07, 2017, 07:33:51 PM »
Thanks stashgrower & josh4trunks! It's quite fun to hear the visualizations proved useful to you folks.

@FrugalFisherman10, that's an interesting question. Based on the data I have there's very little correlation between the return of bonds and the return of stocks over 15 year time frames.

Here's what the data looks like (different random selection of 500 months, but same computer code as the data above).



First of all, we can see the data is, for lack of a better word, clumpy. Months from similar times in history tend to rank in similar positions in terms of bond return percentile, which is not particularly surprising. Interest rates tend to change more slowly than stock market prices.

I ran quick linear regression to look at the relationship between percentile rank in bond returns and percentile rank in stock returns over 15 years (which was the original subject of your question). It turns out that, in this dataset the correlation between bonds and stocks is actually positive (the better months for investing in bonds tend to also be good years for investing in stocks). However this is the type of result that is statistically significant, but not particularly significant for guiding actually decision making (r-squared value is only .04).

Fair disclaimers: 10 year fixed maturity government bonds may or may not be a good representation of returns from investments in bonds generally. My attempt to calculate rates of return for government bonds from the schiller interest rate data may or may not be reasonable.

Edit: now with colorbar to show which colors correspond to which start times.
« Last Edit: February 07, 2017, 07:46:25 PM by maizeman »

FrugalFisherman10

  • Bristles
  • ***
  • Posts: 390
    • Fly Fishing Photo Project
Re: Cash vs Stocks - Risk Tolerance and Timeframes
« Reply #16 on: February 08, 2017, 12:52:17 PM »
Gotcha - thanks for doing that analysis!
So if the dots had clumped up near the areas I highlight in the attached chart, that would have indicated this "90th-10th-fake-phenomena" that I dreamt up?
Clumpy

maizefolk

  • Walrus Stache
  • *******
  • Posts: 7400
Re: Cash vs Stocks - Risk Tolerance and Timeframes
« Reply #17 on: February 08, 2017, 01:31:06 PM »
Yup! For what it's worth, if I ran the analysis using only data from after WWII and cut off the last ten years of history (so the most recent 15 year windows would be 1990-2005), there's actually a reasonably strong negative correlation, just like you described.

So it wouldn't surprise me if people doing similar analyses with other datasets did conclude that the 90/10 phenomena was a real and actionable result.