Mortgage Payment Calculator

Ricardo Carvalho

Shiny App Overview

  • This app calculates mortage rates reactively by taking in user inputs
  • These inputs include cost of the mortgage, downpayment percentage, interest rate and term of the mortgage loan
  • It does not, however, calculate and provide estimates mortgage insurance, real estate taxes, or homeowner's insurance

Features

  • Slider for downpayment percentage
  • Slider for term of loan payment
  • Instant calculations and onscreen explanations (along with amortization equation)
  • App is set in showcase mode so users can see code

The Math and Code behind it

  • The application is instantly calculating the monthly payment via the following formula:
    \[ (\text{Principal})\frac{(\text{Interest rate})(1+\text{interest rate})^\text{Term}}{(1+\text{interest rate})^\text{Term}-1} \]
    • Principal refers to the amount left after the downpayment (which is usually expressed as a percentage of the cost)
    • Term is the amount of time to pay the mortgage, usually 15 to 30 years

An Example and why you want this app

  • For example, for a house with the following parameters…
cost=405000
downpayment=20
interest=3
term=15

…gets evaluated through the following formula:

value = (cost) * (1 - downpayment/100) * (interest/1200) * ((1 + interest/1200)^(term * 
    12))/((1 + interest/1200)^(term * 12) - 1)

…resulting in a mortgage payment of…

[1] 2237.485


So why you want this app?

  • So easy and fun to use!
  • Results are instant and non-cumbersome!
  • Instructions are displayed onscreen!