Question: Detailed Instructions: Given the inputs c r , F V , T , r , you are going to evaluate a bond with annual coupon
Detailed Instructions:
Given the inputs r you are going to evaluate a bond with annual coupon payment
Calculate the bond price.
Note that the interest rate given array is NOT a flat yield
curve, so you cannot discount back everything using one same rate
Calculate the bond price
Find out the implicit yield to maturity
Calculate the Duration of this bond
Suppose the YTM changed, newytm what are the
percentage changes sensitivities in the bond price,
specifically you need to produce an array of using your established duration level
Use matplotlib to plot the rates curve given as
Hint:
IMPORTANT Make sure you use PRINT function to check necessary intermediery outputs
To calculate the bond price, you can do it by compute the pv of fv and coupon separtately
think about how to take the summation for array elements?
To calculate the duration, be careful about the weights!!!
To compute the YTM use numpyfinancial You can use other approches as
well, go find them.
To gauge the sensitivities of price to YTM you need to figure out the array in the first place
PricechangedeltaytmDuration
Part Calculate the bond price
Part Calclulate the duration
Part Find the implicit yield to maturity YTM of the
given term structure
Part Calculate the price percentage changes given
a vector of new YTMs a new yield curve
Part Plot the Rates using Matplotlib
All done in Python pls
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
