1. Learn
  2. /
  3. Courses
  4. /
  5. Bond Valuation and Analysis in Python

Exercise

Comparing the convexity of two bonds directly

You can also investigate the influence of factors on bond convexity by pricing-up two bonds that vary only in this factor and then calculating the convexity of each bond directly.

In this exercise, you will find the convexity of two bonds; both will be 5 year bonds with a yield of 3% and face value of USD 100, but the first bond will pay a 1% coupon and the second bond will pay a 10% coupon.

numpy_financial has already been imported for you as npf.

Instructions 1/2

undefined XP
  • 1
    • Find and print the convexity of a five year bond with a face value of USD 100, annual coupon of 1%, and yield of 3%.
  • 2
    • Find and print the convexity of a five year bond with a face value of USD 100, annual coupon of 10%, and yield of 3%.