johnnyz86

Mortgage Calculations

Mar 21st, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.09 KB | None | 0 0
  1. # monthly payment
  2. def monthly(loanAmount, interestRateQuote=0.04, years=30.0):
  3.     months = years*12.0
  4.     interestRate = interestRateQuote / 12.0
  5.     # Formula to calculate monthly payments
  6.     mortgagePayment = loanAmount * (interestRate * (1 + interestRate)
  7.                                     ** months) / ((1 + interestRate) ** months - 1)
  8.     return mortgagePayment
  9.  
  10. # break even for closing cost
  11. cost_help = 10000 # closing cost help
  12. downpayment = 0.2
  13. other_fee = 0.02 # factoring in tax, fee increase
  14. offer_factor = 1.0 # can increase this to play with offering more than the help on closing costs
  15. mortgage_rate = 0.0425
  16. months_in_year = 12
  17.  
  18. # break_even in years
  19. cost_help * (1 - downpayment - other_fee) /(monthly(cost_help * (1 - downpayment) , mortgage_rate ) * months_in_year)
  20.  
  21. # break even point of buying down/up rate
  22. principle = 448000
  23. # buying down
  24. mortgage_rate = 0.0425
  25. points = 0.0075
  26. rate_incr = -1/8.0/100.0
  27.  
  28. # buying up
  29. mortgage_rate = 0.045
  30. points = 0.0025
  31. rate_incr = 1/8.0/100.0
  32. principle * points /(monthly(principle, mortgage_rate ) - monthly(principle, mortgage_rate + rate_incr ))/months_in_year
Advertisement
Add Comment
Please, Sign In to add comment