
Safe Retirement Spending Using TensorFlow - RockyMcNuts
http://blog.streeteye.com/blog/2016/08/safe-retirement-spending-using-certainty-equivalent-cash-flow-and-tensorflow/
======
danielvf
I was actually paid to build something like this once.

A financial products company wanted a visualization tool that would let a
customer enter their wealth, pick a variety of investment strategies, spending
strategies, and retirement durations, and then see how it all played out over
historical data.

You could scrub a timeline back and forth to change the starting year, and see
your weath and spending charted out over the course of that retirement.

It was best retirement savings education I've ever seen. Almost every
retirement planner just shows you averages, and life looks simple and
predictable. Reality is very, very different.

Things I learned:

1\. The stock market will probably crash at some point during your retirement,
and you will loose half of any wealth you have in it.

2\. In spite of the big drops, the higher compounding rates of stocks mean
that a bond heavy retirement gives you way less money, even in the worst
market retirement years. 30 years lets money grow for a long time.

3\. Attempting to spend as much money as possible drastically increases your
odds of running out of money, or suddenly having a lot less to spend.
(Seriously, what is up with people attempting to run out of money exactly on
their 95th birthday?)

4\. Any retirement planning should take into account that you could end up
with way more, or way less money that you thought.

(Sadly, the web app was never released by the company.)

~~~
h4nkoslo
Planning financial investments for a 50 year time horizon when mass-market
finance has really only been around since ~the 1970s is crazy. An entire
retirement system predicated on long term financial returns > GDP growth,
likewise insane.

There is insufficient data regardless of modeling technique to derive decent
simulation-based conclusions about asset classes that literally didn't exist
50 years ago. There are decent datasets for precious metals, real estate, and
government bonds, but the results aren't super encouraging for average
investors.

~~~
snowwrestler
You're making a weird distinction by saying "mass-market finance" as if the
fundamentals of asset classes change radically depending on how they are
marketed.

Stocks, as an asset class, have been around a lot longer than the 1970s, and
they have on average grown a lot faster than GDP over that time.

That makes sense since stock prices measure a form of wealth, and GDP measures
income. Big difference.

~~~
h4nkoslo
"as if the fundamentals of asset classes change radically depending on how
they are marketed"

More like the fundamentals of asset classes change radically depending on how
they're regulated & taxed, who is willing / able to buy them, what the
composition of that asset class is, and how much money there is flowing in and
out of that asset class.

And we're not even really talking about "fundamentals", since there is so much
path dependency, especially in the context of drawing-down of those assets to
finance retirement. A rise in variance would be bad enough.

Stock prices in the long run represent a time-discounted income stream (as do
all securities) (plus a bundle of legal rights, which is mostly irrelevant for
individuals). It is not mathematically possible to have the stock market
growing by 4% and GDP growing by 2% ad infinitum; you would have the value of
the stock market exceed the discounted value of all future economic activity.

There is a cogent argument that the inflation in stocks has been due to 1)
more economic activity falling under the umbrella of publicly traded
corporations (private blacksmith displaced by Ford), 2) capital inflows driven
by privatized retirement savings, interest rate manipulation, etc. 3) a legal
& economic regime that encourages "paper assets" in general.

None of those are perpetual forces.

~~~
dragonwriter
> It is not mathematically possible to have the stock market growing by 4% and
> GDP growing by 2% ad infinitum

Yes, it is.

First, because there is no _necessary_ mathematical relationship between the
aggregate market cap of firms and economic output (future or otherwise). There
are _rational expectations_ that can be stated, but those aren't actual
constraints, since irrationality is a real thing.

Second, the economic universe from which the stock market draws value is not
limited to the domestic economy, so even if there was a constraint based on
economic output, it wouldn't be GDP.

~~~
h4nkoslo
"Maybe the future will be perpetually irrational about asset prices" is not
really a compelling economic story. There is indeed a mathematical relation
between long run asset prices and the income generated by those assets. In the
short run you can do whatever you want, but the long run constraint is
predictably enforced by arbitrage.

(it is left as an exercise to construct the most entertaining arbitrage play
in a world where stock prices diverge indefinitely from the value produced by
the underlying assets via some magic.)

~~~
dragonwriter
> "Maybe the future will be perpetually irrational about asset prices" is not
> really a compelling economic story.

Perhaps, but then we are getting into _rational expectations_ and not
_mathematical constraints_. (Though, really, given that rationality requires
perfect knowledge of future utilities, "the future will be perpetually
irrational about asset prices" is pretty much guaranteed to be true except for
intermittent times when it isn't momentarily largely by chance; even a
consistent divergence in a particular _direction_ from rationality isn't
surprising, given what we the particular ways in which people tend to be
deviate from economic rationality in practice.)

> There is indeed a mathematical relation between long run asset prices and
> the income generated by those assets.

No, there is a mathematical relation between _reasonable_ asset prices and
_expected_ income streams that the assets will generate.

> In the short run you can do whatever you want, but the long run constraint
> is predictably enforced by arbitrage.

"In the long run, we're all dead" \-- Keynes

Even granting your point for the sake of argument, what must _ultimately_ be
true in the long run assuming an infinite time horizon need never _actually_
be true in the physical universe we inhabit. Irrationality in prices can be
maintained _indefinitely_ , even though not infinitely -- but then, the market
can't actually exist infinitely, anyway.

~~~
smallnamespace
Betting that the market reverts to 'rational' pricing in any short time frame
is a risky bet, but I'll claim it's much, much more reasonable than assuming
that _irrationality persists indefinitely_.

OTOH, there's another story to why equity returns are higher than GDP returns:
equity investors are being compensated for the higher risk.

~~~
adwn
> _OTOH, there 's another story to why equity returns are higher than GDP
> returns: equity investors are being compensated for the higher risk._

This gets mentioned very often in such debates, but the implied causal
connection is wrong: There is no guarantee that higher risk leads to higher
returns. It's not like the stock market says "We should keep up increasing
stock prices so that equity investors are being compensated for their risk."

Over long timespans, stock prices are coupled to the performance of the
underlying companies (mostly their income streams), not to risk. So far, there
has been a correlation, but there has never been a guaranteed causal relation
between risk and stock returns.

~~~
smallnamespace
> There is no guarantee that higher risk leads to higher returns. It's not
> like the stock market says "We should keep up increasing stock prices so
> that equity investors are being compensated for their risk."

The mechanism is much simpler: asset prices of risky assets _today_ will fall
because willing buyers demand a higher return for the risk.

E.g. you have a stock and a bond both at $100 with the same expected return.
Investors aren't happy with that, so they refuse to buy the stock until its
price falls and its implied return rises.

~~~
adwn
Okay, so let's assume that the stocks are traded with a 10% risk discount
($90). Ten years later, the bonds are about to mature and are valued at $150
(50% profit). The company belonging to the stocks has also become 50% more
valuable (because its fundamentals improved, e.g. 50% higher revenue and
profit), but its stocks are still just as risky and still trade at a 10%
discount, for a price of $150 * 90% = $135 (also 50% profit).

So despite the higher risk, and despite the fact that the stock's price is
discounted, the investor did not make more profit from the stocks than from
the bonds.

In practice, companies should grow faster than bonds (because they can
reinvest their profits to increase their profit – although many companies fail
at that), yielding higher returns. My point is, that those higher returns
result from the different mechanisms underlying different security types, not
from differences in risk.

~~~
smallnamespace
You arbitrarily fixed the bond return to match that of stocks, but that's not
how bonds get their prices set.

Bonds are fundamentally less risky than stocks because in the event of
bankruptcy bondholders are paid first. Real recovery rates are around 40%
usually.

> Ten years later, the bonds are about to mature and are valued at $150 (50%
> profit)

No, the value of of the bond is mostly independent of how much the company's
future revenues are (as long as they don't go bankrupt). There are few future
paths where someone will pay you $150 in the future for a bond that you bought
for $100 today.

Bonds mostly have downside risk (you can lose everything), but limited upside
participation. OTOH, equity has worse downside risk (if a company has $700m in
debt and $300m in equity, it only needs to lose $300m in assets to go bankrupt
--but in that case, bondholders would still get paid), but full upside
participation.

Another way of looking at this is that if a company triples in size, your
equity stake also triples because you now own the same percentage of a much
larger company, but the bond cashflows did not change because bonds do not
have that upside.

~~~
adwn
Why are you fixated on bonds? My argument is mostly independent of bonds, I
only included them because you mentioned them originally.

Your reasoning was:

> _The mechanism is much simpler: asset prices of risky assets today will fall
> because willing buyers demand a higher return for the risk. [...] Investors
> aren 't happy with that, so they refuse to buy the stock until its price
> falls and its implied return rises._

I showed that this is not a valid argument, because if the market discounts
the price of a stock by x% due to higher perceived risk, then it will discount
its price by x% ten years later as well (unless there was a major change in
the company's fundamentals, which is another story and not relevant here),
meaning that the discounting of risk did not result in higher profit (compared
to the return on stocks of a company which is deemed less risky).

~~~
smallnamespace
Bonds are the natural comparison _because bonds represent relatively riskless
cashflows_. Bonds tell you how much you get paid in the future, stocks don't.

Otherwise, how can you measure the return to risk?

> then it will discount its price by x% ten years later as well

That doesn't follow because you're missing a free parameter. Let's say a piece
of stock _ought_ to be worth $110 in 1 year if people weren't risk averse
(based on how we think the company will do, etc.), but it'll only be worth
$100 because of the risk. It can still be worth $91 today, implying a 10%
return, for example.

 _For any path of future expected equity values, regardless of what future
discount you apply, there is a price today that will imply an equity risk
premium_.

FYI, people have empirically measured the implied equity risk premium over
long periods of time. The general consensus is that equity returns around
5-10% more per annum that a risk-free asset, but it varies greatly from decade
to decade:

[https://www.newyorkfed.org/medialibrary/media/research/staff...](https://www.newyorkfed.org/medialibrary/media/research/staff_reports/sr714.pdf)

[https://en.wikipedia.org/wiki/Equity_premium_puzzle](https://en.wikipedia.org/wiki/Equity_premium_puzzle)

~~~
adwn
Those are some good points, thank you. I'll have to think about this for some
time.

------
nappy-doo
Anyone who's interested in this kind of thing would do well to visit
[http://www.cfiresim.com/](http://www.cfiresim.com/)

I think it's probably one of the best historical modelling simulators out
there, allows you to save/share your sims, and models all kinds of neat things
like inheritances and expected large expenses.

------
dnadler
What are the units of spend_mean, spend_min and spend_max in the table, and
what exactly are these referring to?

The post says:

>The mean amount you would have been able to spend by year if you had followed
this plan, you retired in years 1928-1985 and you enjoyed a 30-year
retirement.

But I don't really follow... in year 1, spend_mean is 4.567. Does that mean on
average I spend $4.57 in year 1? Is this in addition to the constant spending?

Is variable spending in addition to constant spending? Or is this the % of the
portfolio that I am drawing from by spending my const_spend target?

~~~
sombremesa
I'm assuming it's all dollars. There is no $4.57, it's actually $4,567 (but I
guess the actual number doesn't matter if you treat them all the same).

spend_mean, spend_min, and spend_max are probably the amounts you'd spend if
you were in the mean, min and max respectively. For example, according to this
data, the mean amount you have saved up is ~$667,459 (I calculated this
backwards) - so for the first year you'd spend 2321 + 0.002102*667459 =
$3,724. Likewise if you saved the max in the dataset you'd spend $5,358
instead (total, not in addition to anything).

And yes, the var spending is in addition to const spending, it's explained a
bit lower in the article.

------
arcanus
Fun article.

> "That being said, this optimization seems to run 4-5x faster on CPU than
> GPU."

I'm guessing it is a question of throughput. GPUs are becoming almost like
vector processors, and so if you do not 'feed the beast' then throwing hoards
of threads at the problem will just increase contention, versus improving
scalability.

Sort of embarrassing, as I am a Bayes guy, but I've not seen much MCMC
performed on GPUs. Given the parallelism, I would expect it could nicely
scream with lots of threads (if you also had lots of chains) but this is a
guess.

------
krapht
Interesting example, but the model is unappealing to me. The CRRA assumption
is definitely untrue for most people, including me.

~~~
sombremesa
I agree. I feel that the only reasons to choose an outcome with a value lower
than an expected value are ignorance, or aversion to gambling risk (when
taking a one-time risk rather than averaging over time), neither of which
should be applying here. I'd love to see some counterpoints.

~~~
rgoddard
Being risk-adverse with retirement spending is perfectly rational. Most people
will have to take into minimum expense amounts. Pursuing a strategy which will
have the more likely outcome of not being able to pay your minimum expenses
would not make sense for many people. Comparing only the expected values
without including the volatility is an incomplete comparison.

The critique is aimed at the assumption that your risk aversion is scale
invariant. i.e. you behave the same when the values are in the 10s of dollars,
or the 10,000s of dollars. I might be perfectly fine with taking the coin flip
when the outcomes are either $10 or $15, but if the outcomes are $10,000 or
$15,000 I might rather take a lower guaranteed amount of $12,000 because that
will meet my expenses but the $10,000 won't.

~~~
RockyMcNuts
Fair enough, but for this retirement problem you're comparing outcomes within
1-2 orders of magnitude. If you don't have scale invariance you'll get a
different answer if you put in $100K, $1m and $10m starting portfolios, but
that difference wouldn't tell you anything useful.

IMO best way to look at γ is an arbitrary tunable smoothing parameter, just
tune it until it looks like what you're most comfortable with, trading off
smoothness for maximizing cash flow.

