dstefan
06-06-2008, 12:29 AM
Chapter 2, Problem 10
The yield of a semiannual coupon bond with 6% coupon rate and 30 months to maturity is 9%.
What are the price, duration and convexity of the bond?
Solution:
Input: n = 5; y = 0.09; t_cash_flow = [ 0.5 1 1.5 2 2.5 ]; v_cash_flow = [ 3 3 3 3 103 ].
Output: bond price B = 92.983915, bond duration D = 2.352418, bond convexity C = 5.736739.
The yield of a semiannual coupon bond with 6% coupon rate and 30 months to maturity is 9%.
What are the price, duration and convexity of the bond?
Solution:
Input: n = 5; y = 0.09; t_cash_flow = [ 0.5 1 1.5 2 2.5 ]; v_cash_flow = [ 3 3 3 3 103 ].
Output: bond price B = 92.983915, bond duration D = 2.352418, bond convexity C = 5.736739.