kablamo / Networthify

Personal finance for savings extremists and early retirement savants
https://networthify.com
22 stars 5 forks source link

Retirement plot and table calculations are inconsistent and calculator rounds savings rate to nearest 2% before proceeding #3

Open ragibson opened 3 years ago

ragibson commented 3 years ago

1) Your tables assume a mid-year return of half the annual return rate for new savings, but your primary calculation does not. This makes your table and plot inconsistent.

Here is an example where the obvious answer (using your table's calculations) is 15 years, but the main calculation claims 15.2 years.

plot_table_inconsistency

Note that the desired target net worth

>>> expenses = 50000
>>> annual_withdrawal = 0.04
>>> expenses / annual_withdrawal
1250000.0

is exactly reached at 15 years in your table (ignoring rounding issues in your javascript code). That is, $1.25MM is the resulting value at t = 15:

>>> income = 100000
>>> savings = 50000
>>> expenses = income - savings
>>> portfolio = 69313.90
>>> return_rate = 0.05
>>> withdrawal_rate = 0.04
>>> 
>>> t = 15
>>> savings * (1 + return_rate / 2) * ((1 + return_rate) ** t - 1) / return_rate + portfolio * (1 + return_rate) ** t
1250000.0038315544

2) As an aside, the effective intrayear increase on continuously DCA'd investments with exponential growth is actually r/ln(1+r), but I accept that r/2 is probably "close enough" here, especially considering the site is intended for rough calculation anyway.

>>> r = 0.05
>>> r / log(1 + r)
1.0247967157143927
>>> r = 0.07
>>> r / log(1 + r)
1.0346053546590026
>>> r = 0.10
>>> r / log(1 + r)
1.0492058687257062

3) This is a bit minor, but the calculator rounds the savings rate to the nearest 2% (seemingly to align with the plot) and then proceeds using the rounded rate rather than the values input by the user.

E.g. the savings rate is clearly incorrect (on the left) unless manually input (on the right)

rounding_error

and thus the result is slightly incorrect by default. You can verify the result on the right is more correct via your straightforward annuity calculation (again, temporarily ignoring the fact that this calculation is slightly incorrect for the use case)

>>> from math import log
>>> 
>>> income = 100000
>>> savings = 71000
>>> expenses = income - savings
>>> portfolio = 600000
>>> return_rate = 0.05
>>> withdrawal_rate = 0.04
>>> 
>>> log((savings * withdrawal_rate + return_rate * expenses) / (portfolio * return_rate * withdrawal_rate + savings * withdrawal_rate)) / log(1 + return_rate)
1.2306177277526853
ragibson commented 10 months ago

I thought about this a bit more and put a bit of a re-imagined version at https://ryanagibson.com/posts/analytic-early-retirement-calculator/ -- other than Networthify's rounding, the impact seems to usually be limited to a year or so.

That said, the absolute impact from rounding is especially bad at the lower end if anyone were to try to use it for more typical retirement planning (where I'm pretty sure the usual consensus is a minimum target of ~10%). For relative error, it would be worst for users very close to retirement. no_portfolio_comparison