Plugging that equation into our Python model gives the following code: Where P is the principle investment, C is the yearly contribution, r is the rate of return in the form of 1.0x for x%, and y is the number of years to invest. The equation for regular contributions to an exponentially growing investment is a little trickier, but other people have already figured it out so we'll just use what they did.
Plus, those early years are the most important. What happens if we manage to pull together $12,000 every year and contribute to our nest egg? It's going to be tough in the beginning, but it'll get easier. That's not too bad considering it was just a single contribution from before we could legally drink, but it's probably not enough to last through retirement, what with inflation and health care and all to consider. Our little retirement fund reaches nearly $290,000 by the end of our career. Here's what the value of our nest egg looks like over time: We could be more aggressive and go with 8% or more, as we'll see, but 7% is good for now. Why did I choose 7%? It seems like that's a pretty accepted, if slightly conservative number for how much the market will grow on average over long periods of time. This model calculates the value of this $12,000 investment every year for 48 years using a rate of return of 7%. Plt.title('Exponential Growth of Initial Savings') What does it look like after 48 years? Here's a simple exponential model to give us an estimate: Why $12,000? Because there's 12 months in a year, and that seemed nice. How do we have $12,000 at 20? Maybe it's a gift from a rich aunt and uncle or we saved like crazy during a summer internship between college semesters. How about we put in an initial investment of $12,000 at 20 years old and let it grow until retirement at 67. We'll start with a very simple model to get things started. It is merely an exploration of a model of retirement savings for the purpose of learning and understanding how savings could grow over time.
Let's take a look at how to build up a model in Python to see how much we can save over the course of a career.ĭisclaimer: I am not a financial adviser, so this article should not be taken as financial advice. The data is readily available, and we can explore retirement savings strategies ourselves by writing models in code. As programmers we don't have to simply take these studies at their word. I'm not going to dispute that, but I do want to better understand why it works so well.
It is studied relentlessly, and the general consensus is that it's best to start early, make regular contributions, stick it all in low-fee index funds, and ignore it. We are awash in advice on saving for retirement, with hundreds of books and hundreds of thousands of articles written on the subject.
It's a little less easy to find good investment advice, but still pretty easy.