Financial Risk Management-Fixed Income Markets
In this project you will implement the mortgage calculator is Python:
1. Write a function in Python that will calculate the mortgage payment with the following parameters:
a. yield (the yield should be already adjusted to unit of payment)
b. Principal
c. Number of payments
2. Create a payment column using a replication function in python (hint use numpy arrays and repeat function (see here:
R function rep) in Python (replicates elements of a list/vector) - Stack Overflow)
1. Create a PV column using the formula : P/(1+y) ^ (payment number)
2. Create a first element in the column for outstanding principal assuming that Now Principal utstanding = Intial PrincipalUse the for loop to update the next element in each of the columns as follows;
1. calculate the interest paid through the formula: next interestpaid-principal outstanding*yield
2. calculate the next principal paid as principal paid = payment - interest paid
3. calculate the next amount utstanding = principal outstanding - principal paid
4. complete the amortization table by calculating the PV of principal and interest paid.