|
From: Anastasia A. <ana...@di...> - 2023-01-12 23:07:45
|
Thank you, Luigi!
________________________________
From: Luigi Ballabio <lui...@gm...>
Sent: Wednesday, January 11, 2023 3:03 PM
To: Anastasia Afanaseva <ana...@di...>
Cc: qua...@li... <qua...@li...>
Subject: Re: [Quantlib-users] CPI laggedFixing
Hello Anastasia,
the index fixing used by the cashflow probably takes into account the observation lag. CPI::laggedFixing will work, but it's still not exported to Python in version 1.28. It will be available in version 1.29, hopefully out in a week or two. In the meantime, you can do in Python what that function does in C++ (the code is at <https://github.com/lballabio/QuantLib/blob/QuantLib-v1.28/ql/indexes/inflationindex.cpp#L28>); you'll also have to translate inflationPeriod (<https://github.com/lballabio/QuantLib/blob/QuantLib-v1.28/ql/termstructures/inflationtermstructure.cpp#L349>).
Hope this helps,
Luigi
On Tue, Jan 10, 2023 at 3:42 AM Anastasia Afanaseva <ana...@di...<mailto:ana...@di...>> wrote:
Hi!
I have a problem with the CPI bond.
I want to extract the index fixing on a daily basis (that fixing which is calculated within the cash flow including the inflation lag).
If I apply the index.fixing(ql.Date(...) function, I get the value from the interpolated curve, but not the index which is taken into account when calculating the CPI coupon.
Does the new method from version 1.26 laggedFixing solve this problem ? I did not get how it works, unfortunately.
I have tried different options, ql.CPIBond.laggedFixing((index, ql.Date(31,12,2022), ql.Period(3, ql.Months), ql.CPI.Linear), but the errors like type object 'CPIBond' has no attribute 'laggedFixing' and others occur .
Could anyone advise how to use this method correctly?
Warm regards,
Anastasia
_______________________________________________
QuantLib-users mailing list
Qua...@li...<mailto:Qua...@li...>
https://lists.sourceforge.net/lists/listinfo/quantlib-users
|