mxdevtool-python icon indicating copy to clipboard operation
mxdevtool-python copied to clipboard

How to generate whole yield curve term structure tenors results use Hull White model?

Open jojogh opened this issue 7 months ago • 2 comments

I search all document in the repository, and I found out that the if I use fitted curve, like below:

tenor_rates = [('3M', 0.0151, 0.01), ('6M', 0.0152, 0.01), ('9M', 0.0153, 0.01), ('1Y', 0.0154, 0.01), ('2Y', 0.0155, 0.01), ('3Y', 0.0156, 0.01), ('4Y', 0.0157, 0.01), ('5Y', 0.0158, 0.01), ('7Y', 0.0159, 0.01), ('10Y', 0.0160, 0.01), ('15Y', 0.0161, 0.01), ('20Y', 0.0162, 0.01)]

models = [hw1f] corrMatrix = mx.IdentityMatrix(len(models))

timegrid1 = mx.TimeDateGrid_Equal(refDate=ref_date, maxYear=3, nPerYear=1)

results2 = xen.generate(models=models, calcs=None, corr=corrMatrix, timegrid=timegrid1, rsg=sobol_rsg, filename=filename2, isMomentMatching=False)

ndarray = results2.toNumpyArr()

I found out that ndarray output only contained the very first tenor(3M tenor), may I ask how I can get the whole term tenors generated rates, like 9M, 1Y, 2Y, 3Y,....

jojogh avatar Nov 06 '23 08:11 jojogh