代写 algorithm math python Go MAT1856APM466: Mathematical Finance Winter 2020

MAT1856APM466: Mathematical Finance Winter 2020
Assignment 1: Yield Curves
Professor: Luis Seco, TA: Jonathan Mostovoy
Note: Please bring any questions about this assignment to your TAs, Jonathans, weekly office hour. 1.1 Introduction
For each weekday from Jan 2nd, 2020, until Jan 15th, 2020 inclusive, 2 weeks worth, 10 days, collect all historical close prices for the 32 Canadian Government Bonds which have a maturity less than 10 years from January 15th, 2020 on the Frankfurt Exchange; I.e., all bonds listed via the following two links:
1. https:markets.businessinsider.combondsfinder?borrower71maturityshorttermyield bondtype22c32c42c16couponcurrency184ratingcountry19
2. https:markets.businessinsider.combondsfinder?borrower71maturitymidtermyield bondtype22c32c42c16couponcurrency184ratingcountry19
The data surrounding the 32 bonds found on the above two links will be used for calculating the yield curve ytm curve, spot curve, and forward curve.
To collect the close prices, after markets close on Jan 15th, you must clickthrough to each of the 32 bonds unique page and under Go InDepth click Historical. The close prices will be the rightmost column of prices after selecting Frankfurt as the exchange.
For each bond, you will also need to collect the following information: coupon, ISIN, issue date, maturity date. All this data is available on the Snapshot page before clicking through to the Historical page.
This assignment is split into 2 parts, the first asks questions about some fundamentals of fixed income and mathematical finance. The second will be an empirical exercise in generating yield curves, and in particular the 1, 2, 3, 4 and 5 year rates, and analyzing these rates through PCA.
1.2 Expectations
1. You may use R, Python, or any programming language no Excel without approval from TA before hand of your choice to answer the empirical questions.
2. Please have your final report typeset using LATEXand the following template: template. The website: www.overleaf.com is particularly useful.
3. ImportantNew: Your report must be no longer than 3 pages long in total.
4. Each of the fundamental questions must be answered in clear and coherent sentences no math.
5. At the end of your report you must cite all references and include a link to a GitHub repository with all your code used for the project.
6. You may, and are encouraged, to discuss how to do these questions with your peers. However, your writeup must be done individually, and the sharing of your writeup or code before the deadline is prohibited.
7. A 5 penalty per day past the deadline up until 1 week 35 will apply for late submissions.
Additional Notes: Marks will be awarded for each question as either full, half, or zeromarks according to if the question was answered with a few small mistakes, substantial mistakes but fundamental idea still correct, or fundamental idea wrong no answer respectively. 10 marks each if expectations 2, 3, or 4 not adhered to.
1

Assignment 1: Yield Curves, Luis Seco 2 2 Questions
2.1 Fundamental Questions 25 points
1. 5 points total One sentence each.
a 1 point Why does a government issue bonds?
b 2 points From the governments perspective, why does the yield curve matter?
c 2 points How can a government reduce the money supply through bonds?
2. 10 points We asked you to pull data for 32 bonds, but if youd like to construct a yield a 05 year yield spot curves, as the government of Canada issues all of its bonds with a semiannual coupon, when bootstrapping youll only need 10 bonds to perform this task. Ideally, the bonds in any yield curve should be consistent in some way with one another. Select list 10 bonds that you will use to construct the aforementioned curves with an explanation of why you selected those 10 bonds based on the characteristics we asked you to collect for each bond coupon, issue date, maturity date.
Note: 1 There is a unique ideal answer, 2 To easily refer to a bond, please use the following convention: CAN 2.5 Jun 24 refers to the Canadian Government bond with a maturity in June 24 and a coupon of 2.5.
3. 10 points In a few plain English sentences, in general, if we have several stochastic processes for which each process represents a unique point along a stochastic curve assume pointsprocesses are evenly distributed along the curve, what do the eigenvalues and eigenvectors associated with the covariance matrix of those stochastic processes tell us?
Hint: This is called Principal Component Analysis
2.2 Empirical Questions 75 points
4. 40 points total
a 10 points First, calculate each of your 10 selected bonds yield ytm. Then provide a well labeled plot with a 5year yield curve ytm curve corresponding to each day of data Jan 2 to Jan 15 superimposed ontop of each other. You may use any interpolation technique you deem appropriate provided you include a reasonable explanation for the technique used.
b 15 points Write a pseudocode a simple explanation of an algorithm for how you would derive the spot curve with terms ranging from 15 years from your chosen bonds in part 2. Please also recall the day convention simplifications provided in part 2 as well. Then provide a welllabeled plot with a 5year spot curve corresponding to each day of data superimposed ontop of each other.
c 15 points Write a pseudocode for how you would derive the 1year forward curve with terms ranging from 25 years from your chosen bonds in part 2 I.e., a curve with the first point being the 1yr1yr forward rate and the last point being the 1yr4yr rate. Then provide a welllabeled plot with a forward curve corresponding to each day of data superimposed ontop of each other.
5. 20 points Calculate two covariance matrices for the time series of daily logreturns of yield, and forward rates no spot rates. In other words, first calculate the covariance matrix of the random variables Xi , for i 1, . . . , 5, where each random variable Xi has a time series Xi,j given by:
Xi,j logri,j1ri,j, j 1,…,9
then do the same for the following forward rates the 1yr1yr, 1yr2yr, 1yr3yr, 1yr4yr.
6. 15 points Calculate the eigenvalues and eigenvectors of both covariance matrices, and in one sen tence, explain what the first in terms of size eigenvalue and its associated eigenvector imply.