Dollar convexity
計算債券的「美元凸性」是運用凸性來預測債券價格的重要第一步。這個練習中,你要計算一檔 10 年期、年息 2%、到期殖利率 3%、票面金額 $100 的債券之美元凸性。
回顧一下,美元凸性的公式為:
\( Dollar \ Convexity = Convexity \times Bond \ Price \times 0.01^2\)
numpy_financial 已替你匯入為 npf。
本練習屬於課程
使用 Python 進行債券評價與分析
練習說明
- 求出一檔 10 年期、年息 2%、殖利率 3% 的債券之美元凸性,並印出結果。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Find price of a 10 year bond with 2% coupon and 3% yield, shift yields, and reprice
price = ____
price_up = ____
price_down = ____
# Calculate convexity of the bond
convexity = ____
# Calculate dollar convexity and print the result
dollar_convexity = ____
print("Dollar convexity: ", ____)