Skip to content

turlapati/tvm_analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TVM Analysis Tool

A Python-based financial analysis tool that models the Time Value of Money (TVM) to determine the optimal choice between a Lottery Lump Sum and a Lifetime Annuity.

The tool was inspred by the video Math Just Got Important from MindYourDecisions.

Interactive Desktop App

Features

Real-Time Interactive Parameters:

  • Lump Sum Amount ($500k - $2M)
  • Weekly Annuity Payment ($50 - $10k)
  • Investment Return Rate (0% - 15%)
  • Inflation Rate (0% - 10%)
  • Weekly Expenses ($0 - $10k)
  • Expected Lifespan (20 - 120 years)

Four Dynamic Charts:

  1. Break-Even Analysis - Interest rate where lump sum equals annuity present value
  2. Net Worth Over Time - Wealth accumulation after expenses for both options
  3. Real Purchasing Power - Inflation-adjusted wealth trajectory
  4. Annual Cash Flow - Visual comparison of income vs expenses

Decision Support Metrics:

  • Break-even interest rate calculation
  • Final net worth comparison
  • Optimal choice recommendation
  • Financial advantage quantification

Running the Interactive App

Using uv (recommended):

uv run app.py

Using pip:

pip install -r requirements.txt
python app.py

How to Use

  1. Launch the application
  2. Adjust sliders in the left panel to modify parameters
  3. Charts update in real-time (300ms debounce after slider stops)
  4. Review decision metrics in the right panel
  5. Compare scenarios by adjusting different parameters

Validation Features:

  • Warning banner appears when weekly payment ≤ expenses (unsustainable scenario)
  • Weekly annuity payment slider turns red if payment ≤ expenses
  • All panels resize proportionally when window is resized

Dependencies

  • numpy>=1.24.0,<2.0.0 - Financial calculations and array handling
  • matplotlib>=3.7.0,<4.0.0 - Chart generation
  • flet>=0.25.0,<1.0.0 - Interactive desktop app UI

📋 Prerequisites

  • Python 3.8+
  • uv (recommended) or pip

Understanding the Analysis

Break-Even Rate

The interest rate at which the present value of annuity payments equals the lump sum. If you can achieve returns above this rate, the lump sum is typically better.

Net Worth Projection

Shows how your wealth grows over time considering:

  • Investment returns
  • Weekly expenses
  • Payment structure (lump sum vs annuity)

Real Purchasing Power

Accounts for inflation to show the actual buying power of your money over time.

Optimal Choice

Based on your parameters, the analysis recommends which option maximizes your final net worth.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages