lballabio / quantlib-old

The QuantLib C++ library and extensions (warning: out of date)
http://quantlib.org
470 stars 406 forks source link

Fetch inflation fixing from first day of the relevant month #333

Closed lballabio closed 8 years ago

lballabio commented 8 years ago

See http://sourceforge.net/p/quantlib/mailman/message/30816526/

lballabio commented 8 years ago

@fametrano , @pcaspers : do you think this makes sense? With this patch, asking for the fixing of the inflation index at any past date would look for it at the start of the inflation period. It avoids storing the same fixing for all days, but it might be surprising. What do you think?

pcaspers commented 8 years ago

At best we would store the fixings with (month,year) as a key instead of (day,month,year), but this would require a new index class probably. So the solution sounds not bad. But I might be biased because Murex stores CPI fixings the same way (on the 1st calendar day of a month, the other days contain NULL), so I am used to this kind of representation.

On 23 October 2015 at 16:59, Luigi Ballabio notifications@github.com wrote:

@fametrano https://github.com/fametrano , @pcaspers https://github.com/pcaspers : do you think this makes sense? With this patch, asking for the fixing of the inflation index at any past date would look for it at the start of the inflation period. It avoids storing the same fixing for all days, but it might be surprising. What do you think?

— Reply to this email directly or view it on GitHub https://github.com/lballabio/quantlib/issues/333#issuecomment-150598941.

lballabio commented 8 years ago

Ok, so if we're not the only ones then it does kind of sense at least...

lballabio commented 8 years ago

Ok. Pending further feedback, I'll apply this patch but leave the behavior in InflationIndex::addFixing that stores the giving fixing over the whole month. I'll document the change and remove the override in next release, so if anyone has written code that relies on the month being filled (shudder) they'll have time to repent and change their ways.

igitur commented 8 years ago

I believe https://github.com/lballabio/QuantLib/pull/50 will address Gerardo's concern about the period used for interpolation.