百分比久期與美元久期
在實務上,美元久期與 DV01 更常被用來快速衡量單一債券或投資組合的利率風險。它們也可用於含有利率風險的其他金融商品。
在這個練習中,你要計算一檔債券的美元久期與 DV01。該債券到期年限為 30 年,票面利率 3.5%,到期殖利率 5%,面額為 USD 100。
numpy_financial 已為你匯入為 npf。
本練習屬於課程
使用 Python 進行債券評價與分析
練習說明
- 以一般方式計算一檔 30 年期、票面利率 3.5%、殖利率 5% 的債券久期。
- 計算該債券的美元久期。
- 計算該債券的 DV01。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Find the duration of the bond
price = ____
price_up = ____
price_down = ____
duration = ____
# Find the dollar duration of the bond
dollar_duration = ____ * ____ * ____
print("Dollar Duration: ", ____)
# Find the DV01 of the bond
dv01 = ____ * ____ * ____
print("DV01: ", ____)