Overview
A very simple calculation assumes that the retiree can plan a fixed amount of money required for each year of retirement, and a fixed interest rate that is earned on retirement savings. Then, assuming we have a fixed number of years in retirement, the amount of money required in the retirement portfolio can be calculated.
Retirement Withdrawals
Once you have saved a given amount of money, you will begin to witdraw from it during retirement. We present a formula that computes your remaining savings at year {% D %} of retirement assuming that your savings are invested at a rate {% R %}, and you withdraw a constant amount labeled Withdrawal.
{% Remaining \: Savings_D = Initial \: Savings(1+R)^D - Withdrawal \times \sum_{j=1}^D (1+R)^{D-j} %}
Here, {% Remaining \: Savings_D %} is the amount of savings left in year {% D %} of retirement.
The formula is calculated as two terms:
- The amount invested at retirement, growing at a rate {% 1+R %} every year. This would be the amount present if there were no withdrawals
- Subtract the amount of money withdrawn every period, and compounded up to the year {% D %}
If we want to have enough savings for {% D %} years of retirement at the given withdrawal amount, we need
{% Initial \: Savings = Withdrawal \times \sum_{j=1}^D 1/ (1+R)^j %}
That is, this formula sets {% Remaining \: Savings_D = 0 %} in the above.
Implementation
The following code implements the equations above to calculate how large a retirement portfolio one needs.
let periods = 20;
let rate = 0.05;
let savings = 0;
let withdrawal = 40000;
for(let j=1;j<=periods;j++){
savings += withdrawal/Math.pow(1+rate, j)
}