Introduction to Financial Concepts in Python
Dakota Wixom
Quantitative Finance Analyst
A mortage is a loan that covers the remaining cost of a home after paying a percentage of the home value as a down payment.
Example:
To convert from an annual rate to a periodic rate:
$ {R}_{Periodic} = (1 + R_{Annual})^\frac{1}{N} - 1 $
Example:
Convert a 12% annual interest rate to the equivalent monthly rate.
$ (1 + 0.12)^\frac{1}{12} - 1 = 0.949\% \text{ monthly rate}$
You can use the NumPy function .pmt(rate, nper, pv)
to compute the periodic mortgage loan payment.
Example:
Calculate the monthly mortgage payment of a $400,000 30 year loan at 3.8% interest:
import numpy as np
monthly_rate = ((1+0.038)**(1/12) - 1)
np.pmt(rate=monthly_rate, nper=12*30, pv=400000)
-1849.15
Introduction to Financial Concepts in Python