|
From: Brian S. <bri...@gm...> - 2020-11-27 18:10:37
|
Many thanks for your reply.
However if I want to estimate the Zero-rate for some arbitrary date
(other than the supplied Nodes), then what method should I use? Below
code to fetch the same generates some error.
>>> spotCurve.zeroRates(Date(1,3,2021))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: zeroRates() takes exactly 1 argument (2 given)
Thanks for your insight.
Regards,
On Fri, 27 Nov 2020 at 14:03, Luigi Ballabio <lui...@gm...> wrote:
>
> Hello,
> you can retrieve them from spotCurve (methods dates(), zeroRates() or nodes()) but not from spotCurveHandle, which only has the interface of the base YieldTermStructure class.
>
> Luigi
>
>
> On Thu, Nov 26, 2020 at 11:38 PM Brian Smith <bri...@gm...> wrote:
>>
>> Hi,
>>
>> Let say I build a term structure like this -
>>
>> from QuantLib import *
>> import math
>>
>> todaysDate = Date(1, 9, 2019)
>> Settings.instance().evaluationDate = todaysDate
>> dayCount = Actual365Fixed()
>> calendar = Canada()
>> interpolation = Linear()
>> compounding = Compounded
>> compoundingFrequency = Continuous
>>
>> spotDates = [todaysDate, todaysDate + Period("6m"), todaysDate +
>> Period("1y"), todaysDate + Period("2y"), todaysDate + Period("3y")]
>> spotRates = [0, 0.061682, 0.066682, 0.067199, 0.067502]
>>
>> spotCurve = ZeroCurve(spotDates, spotRates, dayCount, calendar,
>> interpolation, compoundingFrequency)
>> spotCurveHandle = YieldTermStructureHandle(spotCurve)
>>
>> Now, from the spotCurveHandle object, I want to extract all Nodes
>> dates and rate information. Ofcourse I can get such information from
>> spotDates and spotRates respectively, however I am looking for some
>> way to extract the same information from the spotCurveHandle itself.
>>
>> Is there any method to do the same?
>>
>> Thanks for your insights.
>>
>>
>> _______________________________________________
>> QuantLib-users mailing list
>> Qua...@li...
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
|