凸性調整
使用凸性調整是把存續期間與凸性結合起來預測債券價格變動的下一步。在本練習中,你要計算一檔 10 年期零息債,殖利率 5%,票面金額 USD 100 的凸性調整。
回想一下,凸性調整的公式為:
\( Convexity \ Adjustment = 0.5 \times \ Dollar \ Convexity \times 100^2 \times (\Delta y)^2\)
numpy_financial 已為你匯入為 npf。
本練習屬於課程
使用 Python 進行債券評價與分析
練習說明
- 求出 10 年期零息債的凸性調整,並印出結果。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# 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: ", ____)