Convexity adjustment
Finding the convexity adjustment of a bond is the next step in using both duration and convexity to predict changes in bond prices. In this exercise, you are going to calculate the convexity adjustment for a 10 year zero coupon bond with a yield of 5% and face value of USD 100.
Recall that the formula for the convexity adjustment is given by:
\( Convexity \ Adjustment = 0.5 \times \ Dollar \ Convexity \times 100^2 \times (\Delta y)^2\)
numpy_financial
has already been imported for you as npf
.
This exercise is part of the course
Bond Valuation and Analysis in Python
Exercise instructions
- Find the convexity adjustment for a 10 year zero coupon bond and print the result.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Find price of 10 year zero coupon bond with a 5% yield, shift yields, and reprice
price = ____
price_up = ____
price_down = ____
# Calculate convexity and dollar convexity of the bond
convexity = ____
dollar_convexity = ____
# Find the convexity adjustment and print the result
convexity_adjustment = ____
print("Convexity adjustment: ", ____)