开始使用免费开始使用

求一只债券的凸性

计算债券的凸性是更全面预测债券价格变动并衡量投资组合利率风险的重要步骤。

在本练习中,您将计算一只期限为 20 年、年票息率 6%、到期收益率 5%、面值为 100 美元的债券的凸性。

回忆凸性的公式:

\( Convexity = \frac{ P(down) \ + \ P(up) \ - \ 2 \times P }{P \ \times \ (\Delta y)^2} \)

numpy_financial 已为您导入为 npf

本练习是课程的一部分

用 Python 进行债券定价与分析

查看课程

练习说明

  • 计算一只 20 年期、票息率 6%、收益率 5% 的债券价格。
  • 计算在收益率分别上升 1% 和下降 1% 时,同一只债券的价格。
  • 计算该债券的凸性并打印结果。

交互式实操练习

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

# Find the price of a 20 year bond with 6% coupon and 5% yield
price = ____

# Find the price of the same bond for a 1% higher and 1% lower level of yields
price_up = ____
price_down = ____

# Find the convexity of the bond and print the result
convexity = ____
print("Convexity: ", ____)
编辑并运行代码