I was creating an yield curve using zeroRate, when I read back the value from the created yield curve - it differs from expectation.
tod = ql.Date(5,5,2022)
ardates = [tod, tod+ql.Period(1,ql.Weeks), tod+ql.Period(1,ql.Months), tod+ql.Period(3,ql.Months),
tod+ql.Period(6,ql.Months),tod+ql.Period(1,ql.Years),tod+ql.Period(2,ql.Years) ]
arzeros = [0.43902, 0.80713,1.0581, 1.19588,1.64246, 2.2557, 2.72901]
arc1 = ql.ZeroCurve(ardates, arzeros, ql.Actual360(), ql.UnitedStates())
arc2 = ql.CubicZeroCurve(ardates, arzeros, ql.Actual360(), ql.UnitedStates())
On trying to retrive the value of zero rate from these yield curves ...
print(arc1.zeroRate(0, ql.Compounded, ql.Continuous).rate())
0.4932915599104186 ; expected value was ~0.43902
print(arc1.zeroRate(1, ql.Compounded, ql.Continuous).rate())
4.125908149916458 ; expected value was ~2.2557
print(arc1.zeroRate(2, ql.Compounded, ql.Continuous).rate())
5.772093785892491; expected value was ~2.72901
Can someone help me on this matter ? I have defined the yield curve - rate for a date. I want to read out the value as is, but that is not happening.
Regards, Rohit