|
From: Peter C. <pca...@gm...> - 2014-07-10 23:11:19
|
Hi Francois, with your fix I get the correct interpolated value (115.883) in my case below and the test suite seems to run without any regression, so it looks like it is working well. I have to set the interpolation to CPI::Linear in the coupon to get this though. With CPI::AsIndex (and interpolation = true in the index definition) I get the original (wrong) interpolated value (115.85774). Also indexFixing() always returns this value no matter what interpolation is set in the coupon (which is consistent then I guess). I don't know if this makes sense, maybe we have to apply the same logic as for the coupon to the index as well, i.e. in ZeroInflationIndex::fixing( aFixing, reference ) we should take care of the reference date just in the same way as you did in the coupon ? In any case, your fix is a step forward. I didn't really check the code changes you made but noticed that you changed the reference date in TermStructure from private to protected. Is there a particular reason for that (you don't seem to need or even use this) ? Thanks a lot Peter On 10 July 2014 16:36, Francois Botha <ig...@gm...> wrote: > Peter, > > Here is my first attempt at solving this bug. Can you confirm whether it > solves your problem? > https://github.com/igitur/quantlib/tree/inflation_reference_period_fix > > Francois Botha > > > On 18 June 2014 17:27, Francois Botha <ig...@gm...> wrote: >> >> Haha. I actually did read your email the other day, but I didn't make the >> connection when I discovered the issue now. No fix yet, but I'll see if I >> can get something together. It will have to involve passing the original >> reference date through to the fixing algorithm. >> >> F >> >> Francois Botha >> >> >> On 18 June 2014 17:17, Peter Caspers <pca...@gm...> wrote: >>> >>> Hi Francois, >>> >>> yes, you have to use June's 30 days. This is corresponding to the >>> question I sent earlier (see below), the second (Murex) way of doing >>> the interpolation is the correct one. >>> >>> Do you have a fix for that ? This would be great. >>> >>> best >>> Peter >>> >>> I am comparing Murex and QuantLib concerning Inflation Pricing. I >>> observe a difference in the way an index fixing is interpolated >>> between known (i.e. already fixed) values. Here is an example: >>> Take the EUHICP XT index which has fixings >>> 01.08.2012 (Aug 12) 115.10 >>> 01.09.2012 (Sep 12) 115.97 >>> Now I want to look up the fixing on 28.08.2012 belonging to an >>> observation date on 28.11.2012 (3m observation lag). In QL the >>> interpolation is done as follows: >>> Days between 01.08. and 01.09. = 31, Days between 01.08. and 28.08. = >>> 27, Interpolated Fixing = 115.10 + 27/31 * ( 115.97 - 115.10 ) >>> In Murex on the opposite: >>> Days between 01.11. and 01.12. = 30, Days between 01.11. and 28.11. = >>> 27, Interpolated Fixing = 115.10 + 27/30 * ( 115.97 - 115.10 ) >>> >>> On 18 June 2014 16:50, Francois Botha <ig...@gm...> wrote: >>> > Hi, >>> > >>> > I think the interpolation in ZeroInflationIndex::fixing isn't exactly >>> > correctly. >>> > >>> > Consider a linearly interpolated Zero Inflation Index with observation >>> > lag >>> > of 4 months. If the reference date is in June, the observation date >>> > will be >>> > in February, which has only 28 days. I believe the interpolation should >>> > use >>> > June's 30 days instead of February's 28 days. As it is, the >>> > interpolation >>> > will be "maxed out" by 28 June and will remain flat until 30 June. Do >>> > you >>> > guys agree? >>> > >>> > regards >>> > Francois Botha >>> > >>> > >>> > ------------------------------------------------------------------------------ >>> > HPCC Systems Open Source Big Data Platform from LexisNexis Risk >>> > Solutions >>> > Find What Matters Most in Your Big Data with HPCC Systems >>> > Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. >>> > Leverages Graph Analysis for Fast Processing & Easy Data Exploration >>> > http://p.sf.net/sfu/hpccsystems >>> > _______________________________________________ >>> > QuantLib-dev mailing list >>> > Qua...@li... >>> > https://lists.sourceforge.net/lists/listinfo/quantlib-dev >>> > >> >> > |