程序代写案例-FIN 448
时间:2021-03-31
FIN 448: Fixed Income Securities
Problem Set 1 - Solution
Pavel Zryumov
Due 11:59pm on March 26, 2021
Note: Please submit your homework assignment on BlackBoard. You must submit a pdf
file with the main results and derivations as well as the corresponding Jupyter notebook.
- PDF: You can either type up your solution or write it on paper and use a pdf scanner
app on your phone to convert it to pdf. There are many free iPhone and Android pdf
scanner apps (Dropbox, Adobe Scan, etc.). Let me know if you are having problems
with this step
- Jupyter Notebook: Please submit one .ipynb file. The file has to work in the same
folder as the data file. TAs will run all cells exactly once and grade it based on the
generated output. The best way to ensure that your code works is to click “Kernel →
Restart and Run All” and check the generated output.
All groups must complete this assignment individually without cooperation with other
groups.
The file hw1-data.csv contains prices of Treasury Bills (Type 4) and Notes (Type 2) on
December 31st, 2018.
1. Simple calculations:
(a) Take a bill maturing on 03/14/2019. It’s time to maturity in 0.2. Compute the
continuously compounded spot rate r(0, 0.2)
1
Solution. The price of the Bill is $99.524486, hence the rate r(0, 0.2) solves
e−r(0,0.2)×0.2 = 0.99524486
r(0, 0.2) = − 1
0.2
ln(0.99524486)
r(0, 0.2) = 0.023832
(b) Consider first two notes (maturing on 06/30/2019 and 12/312019). Bootstrap
continuously compounded spot rates r(0, 0.5) and r(0, 1) from the note prices
(you need to compute ZCB prices first).
Solution. The note with time to maturity 0.5 is a zero coupon bond with a final
payment of 1.25/2 + 100, hence
B(0, 0.5) =
99.386719
1.25/2 + 100
= 0.987694.
The note with time to maturity 1 has two payments 1.875/2 and 1.875/2+100,
hence
B(0, 1) =
99.277344− 1.875/2 ∗B(0, 0.5)
1.875/2 + 100
= 0.974379.
The spot rates can be computed as
r(0, 0.5) = − 1
0.5
ln(B(0, 0.5)) = 0.024764
r(0, 1) = −1
1
ln(B(0, 1)) = 0.025955
(c) Compute continuously compounded f(0, 0.5, 1)
Solution. Continuously compounded rate f(0, 0.5, 1) solves
1
2
r(0, 0, 5) +
1
2
f(0, 0.5, 1) = r(0, 1)
f(0, 0.5, 1) = 2r(0, 1)− r(0, 0.5) = 0.02714537
2
(d) Compute a semi-annually compounded 1-year par rate.
Solution. The 1 year par rate c is defined as
c
2
B(0, 0.5) +
( c
2
+ 1
)
B(0, 1) = 1
c = 2 · 1−B(0, 1)
B(0, 0.5) + B(0, 1)
c = 0.0261162
2. (Python) Consider first only Treasury Bills.
(a) Convert T-Bills prices to the continuously compounded spot rates. (In order to
convert days to maturity to years use 365-day year.)
(b) Plot the yield curve (this is the short end of the overall yield curve). Is it upward
or downward sloping?
Solution. The general approach is exactly the same as in the Problem 1(a). See the
ps1-sol.ipynb for details.
3. (Python) Next consider T-Notes.
(a) Bootstrap the continuously compounded spot rate curve for all maturities (this is
the middle part of the overall yield curve). In order to convert days to maturity
to years round up to 0.5 years (0.5, 1, 1.5, etc.). Plot the yield curve.
(b) Compute and plot a continuously compounded forward curve, i.e., forward rates
f(0, 0.5, 1), f(0, 1, 1.5), f(0, 1.5, 2) and so on.
(c) Compute and plot the semiannually compounded par curve.
Solution. The general approach is exactly the same as in the Problem 1(b), 1(c), and
1(d). See the ps1-sol.ipynb for details.
3


























































































学霸联盟


essay、essay代写