This post will introduce the first part (of multiple) where we build up a personal finance model to help simulate future time periods based on certain chosen input variables. We will input variables such as our current investable asset base, our annual salary, expected monthly inflows and outflows and a range of other relevant values. Firstly, after our necessary imports, we look to start on modelling inflows over time.
import pandas as pd import numpy as np import random import pandas_datareader.data as web import datetime import matplotlib as mpl import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize'] = (12,6) # Set up model inflows inflows = {'active_annual_income':50_000} variables = {'start_date' : "01/01/2020", 'years': 10} income_gains_storage = [] months = variables['years'] * 12 for month in range(months): income = inflows['active_annual_income'] / 12 income_gains_storage.append(income) plt.plot(pd.Series(income_gains_storage).cumsum()) plt.show()

This looks like a pretty simplistic results, the cumulative income we have earned over 10 years, at 50k annual salary is unsurprisingly 10 x 50,000 = 500,000. One thing we might want to introduce is some logic to account for the fact the nasty tax man gets his hands on at least some (way too much) of it. For the moment, for simplicity’s sake, I will assume a flat tax rate of 25%. Of course most countries have a sliding scale of income bands which are subject to increasing rates of tax the more one earns. We can come back to this later and see if we can implement something more along those lines – but for now lets stick with our flat 25%.