具有正常波动性的QuantLib Python HullWhite可赎回债券

2024-10-16 17:21:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用下面的QuantLib Python Cookbook的方法和Hull White模型评估几种可赎回债券

  1. ql.HullWhite中下面的西格玛是正常还是对数正常 波动性

  2. 如果是对数正态,有没有办法将正常波动率输入ql.HullWhite

多谢各位

bond = ql.CallableFixedRateBond(
    settlement_days, face_amount,
    schedule, [coupon], accrual_daycount,
    ql.Following, face_amount, issue_date,
    callability_schedule)

def value_bond(a, sigma, grid_points, bond):
    model = ql.HullWhite(ts_handle, a, sigma)
    engine = ql.TreeCallableFixedRateBondEngine(model, grid_points)
    bond.setPricingEngine(engine)

value_bond(0.03, 0.12, 40, bond)
print("Bond price: %lf" % bond.cleanPrice())

Bond price: 68.396593

Tags: modelvalue对数amountpricesigmaenginepoints