开始使用免费开始使用

零息债与付息债的久期

久期是衡量利率风险的指标,适用于任何债券,无论是否支付票息。

在本练习中,您将计算一只期限为 10 年、面值 100 美元、到期收益率为 3% 的零息债券的久期,并将其与同一只年票息率为 3% 的付息债券的久期进行比较。numpy_financial 已为您导入为 npf

回忆久期的计算公式:

\(Duration = \frac{P(down) \ -\ P(up)}{2\ \times\ P\ \times\ \Delta y}\)

本练习是课程的一部分

用 Python 进行债券定价与分析

查看课程

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Find the price of the zero coupon bond at current yield levels
price = ____

# Find the price of the zero coupon bond at 1% higher yield levels
price_up = ____

# Find the price of the zero coupon bond at 1% lower yield levels
price_down = ____

# Calculate duration using the formula and print result
duration = (____ - ____) / (____ * ____ * ____)
print("Zero Coupon Bond Duration: ", ____)
编辑并运行代码