Skip to content

ktxlh/wealth-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wealth Simulator

A Python-based personal finance simulation tool that helps project future wealth based on various income, expense, and investment parameters. It accounts for inflation, taxes, major life events (buying a home, having children), and market returns.

It is designed for a similar-age couple living in California, United States, currently renting their residence.

Requirements

  • Python 3.x
  • numpy
  • matplotlib

Install dependencies using:

pip install -r requirements.txt

How to Run

  1. Open config.py.
  2. Edit the CONFIG dictionary at the top of the file to match your personal financial situation and assumptions.
  3. Run the script:
python wealth_simulator.py
  1. The script will generate a plot showing your projected wealth over time, named `wealth_simulation.png' in this directory.

Configuration Guide

The CONFIG dictionary in config.py contains all the tunable parameters for the simulation:

Basic Information

  • start_age: Age at the start of the simulation.
  • end_age: Age at which the simulation ends.
  • retire_after_years: Number of years from start until retirement.
  • current_wealth: Total initial liquid assets (cash + stocks).
  • current_annual_salary: Current gross annual income.

Economic Factors

  • annual_raise_percent: Expected annual salary increase percentage.
  • annual_inflation_percent: The annual inflation rate applied to costs and tax brackets.
  • stock_annual_return_percent: Expected annual return on stock investments.
  • savings_annual_return_percent: Expected annual return on safe savings.

Asset Allocation

  • wealth_in_stock_percent: Percentage of portfolio allocated to stocks.
  • wealth_in_saving_percent: Percentage of portfolio allocated to savings (should sum to 100 with stock %).

Expenses

  • current_annual_cost: Base annual living expenses (excluding rent and specific items below).
  • current_rent_monthly: Current monthly rent.

Family Planning

  • add_child_in_x_years: List of years from now when a child is born (e.g., [1, 4]).
  • child_duration_years: Number of years a child is a financial dependent.
  • annual_child_cost: Annual cost per child (adjusted for inflation).

Real Estate

  • buy_x_dollar_home_in_y_years: List of tuples (Price, YearsFromNow) representing planned home purchases.
  • annual_home_price_increase_percent: Expected annual appreciation of home value.
  • property_tax_base_percent: Property tax rate as a percentage of assessed value.
  • prop13_assessment_increase_cap: Cap on annual property tax assessment increase (relevant for California prop 13).
  • mortgage_rate_percent: Annual mortgage interest rate.
  • mortgage_term_years: Length of the mortgage in years.
  • home_down_payment_percent: Down payment percentage.
  • home_maintenance_percent: Annual maintenance cost as a % of home value.
  • home_insurance_percent: Annual insurance cost as a % of home value.
  • home_transaction_fee_percent: Costs associated with buying/selling property.

Vehicles

  • current_car_value: Current market value of your car.
  • current_car_age: Age of your current car.
  • annual_car_value_decrease_percent: List of tuples defining depreciation rates based on car age.
  • buy_x_dollar_car_in_y_years: List of planned car purchases (Price, YearsFromNow).
  • car_insurance_maintenance_annual: Annual cost for car insurance and maintenance.

Retirement & Taxes

  • retirement_medical_annual: Estimated annual out-of-pocket medical costs in retirement.
  • capital_gains_tax_fed: Federal capital gains tax rate.
  • capital_gains_tax_state: State capital gains tax rate.

About

A Python-based personal finance simulator for California residents to project long-term wealth, factoring in taxes, real estate, inflation, and family planning.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages