# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# +
import pandas as pd
import numpy as np

import matplotlib.pyplot as plt
import matplotlib
import seaborn as sns
plt.style.use('ggplot')
plt.style.use(['dark_background'])
# -

# ## Motivation
#
# I just had a conversation with a friend who is looking to get a hold of her own finances but doesn't know where to start. I couldn't find a good summary that reduces the math down to a simple terms. MMM comes close. So I just decided to write my own piece.
#
# ## Financial Independence
# Financial independence is the idea that you've "invested" enough money so that these investments start "passively" making money for you. The basic principle is that you leave the original investment untouched and simply shave the excess of every year. If that investment generates enough for you to live on, congratulations you're now financially independent. 
#
# You can pursue that passion project you've always wanted to start but the 9 to 5 never left you with enough time/energy to do. Your house, groceries, etc are paid for. You don't have to work unless you get bored and want to.  You've bought your way out of the system.
#
# > IMAGE of root beer
#
#
#
# ##  But how much money do you need? 
#
# Well, that's where things get complicated for many people. They read about different asset classes, market cycles, balancing portfolios, etc and decide: "I'll just pay someone else to do this for me."  Or worse, I will just save 20% and call it good enough.
#
# However, not everyone can afford a financial planner and simply not thinking about it is a great way to never retire.
#
# The good news is that we simplify things if we stop trying to "beat" the system. 
#
# The market grows every year right? We'd have problems if it didn't...  What if there was a single stock that simply followed the market's inherent growth? If you chose to simply put ALL your excess money into that stock... maybe that could be enough? 
#
# That's what I hope to dive into with this post.
#
# ## Introducing the 4% rule
#
# The basic assumption is that, on average, the market grows 7% every year and that the SP500 (for simplicity let's just call this "a stock") follows that growth. So if you put \\$100 into that "stock" this year, you can expect to have \\$107 next year (on average).  But, of course, inflation decreases the value of that \\$107 by about 3% every year (yes, your money is basically on fire if you leave it in cash).  
#
# > sp500 plot
#
# Thus, we have the 4% rule.  This simply says that you can expect 4% growth of your investment every year assuming the market grows 7% and you lose 3% of that to inflation.  
#
# It's crude. It's reductionist. But it turns out to be good enough to get started. There are many arguments that can be made against this "rule of thumb" but I think MMM handles them well so I won't list them here. 
#
# ## Applying the 4% rule
#
# Remember, we want to keep our initial investment "untouched" when we retire so we can just shave the cream off the top every year.  If that "cream," is enough to live on, then we can retire.  So we need our "nest egg" to be large enough such that 4% of it matches our standard of living (how much we spend). 
#
# Again, how much money is that? 
#
# Well, if we use the 4% rule above, it turns out to be 25 times the amount that you spend every year.  So if you spend \\$100,000 a year then you'd need to save \\$2.5 million to retire.  That seems like a lot. But if you can live off \\$40,000, it reduces to \\$1 million. 
#
# "What you need to retire" = 25 x "what you require to live"
#
# To make it visual, I plotted your nest-egg size (in millions) vs your annual spending budget (in thousands).

upper_lim = 200
plt.figure(figsize=(16,8))
spending = np.linspace(10,upper_lim,100)
nestegg  = spending * 25 / 1000
plt.plot(spending,nestegg,c='c')
plt.grid(alpha=0.1); plt.ylabel('Needed for Financial Independence (Millions $)',fontsize=18)
plt.xlabel('How much you spend annually (Thousands $)',fontsize=18)
matplotlib.rcParams.update({'font.size': 22})
plt.xlim(0,upper_lim); plt.suptitle('How much to save before Financial Independence',fontsize=25)
plt.show()

# ## Lower your Living Standard >> Break Free Faster
#
# As I looked for articles for my friend, I kept finding things that said "well just make sure you save 10 to 20% and you'll be fine." 
#
# Contrary to this theory, it's not how much you earn but how much you can save.  Of course earning a lot helps, but the rate that you **save** is heavily influenced by how much you **spend**. As you spend more, 
# - you save less of your income 
# - your "retirement target" gets bigger/harder to reach (again see plot above)
#
# Spend less, save faster. Spend more, make it reallllly difficult to retire. 
#
# ## But ... my kids' college, house payments, health care, etc.
#
# Exactly. Start thinking about how much things cost.  
#
# How much of a difference is it to eat-in vs eat-out? How much do you expect to pay for rent or house payments? We all need to unwind so how much do my "nights out" cost? All of these things fall under "cost of living." 
#
# The best way to stay stuck in the work-for-someone-else lifestyle, is to act like these things are too complicated for you.  Get a spreadsheet out and start playing around.  
#
# How much do you need to retire given the above calculation?  Can you cut costs anywhere to make it easier to hit that mark? 
#
# Remember as you cut costs, the number you need to hit goes down AND you're able to save faster on the same income.



# ## How long do I have to retire?
#
# Well, we've got the first step. We have calculated how much we need to retire based on our "tastes" in lifestyle.  However, most people care about how long do they have to work 
#
# ## The true cost of buying something
#
# So that's it. If you can determine what your standard of living is, you can determine how much money you could retire on if you put all your savings into the SP500 and just milked that as your retirement plan.  But the key is calculating how much you spend.  Notice in the plot above that if you spend \\$50,000 a year that you could retire after you had just over a million dollars.  However, if you insist on living at $200,000 a year, you would need to acquire 4x that amount. It's just simple math, 
#
#
#
# However, it's actually not as simple as working 4 times as long.  Because you're actually 
#
# ## But... I like {insert expensive thing}
#
# That's totally fine. If you can't find a sufficient substitute etc... MMM has a great argument for this...
#
# It's about being happy... not about keeping up. If you need that thing and there is absolutely nothing else that fu7lfills that need in your life. Then you know where you draw your line.
#
#



StarcoderdataJupyterScriptsDedupFiltered