Hi All
I am trying to implement Inflation Linked Gilt. Is there a general advice on what part of quantlib I can reuse? I think I can probably reuse InflationTermStructurem, InflationIndex, and Bond. Any implementation advice?
Thanks Leon
------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
On Thu, 2011-01-06 at 15:00 -0600, Leon Sit wrote:
> I am trying to implement Inflation Linked Gilt. Is there a general > advice on what part of quantlib I can reuse? I think I can probably > reuse InflationTermStructurem, InflationIndex, and Bond. Any > implementation advice? You'll probably want to inherit a class from Coupon that takes an InflationIndex and uses it to implement its rate() and accruedAmount() methods (possibly a ZeroInflationIndex. I find it easier to cope with; the YoYInflationIndex is a bit more quirky about retrieving fixings.) Once you have the coupon, you can inherit a class from Bond. The constructor will assemble the correct cash flows. If you're lucky, that would be all; if instead your bond price must be rescaled by some inflation factor, you'll have to put that calculation somewhere. You might override performCalculation to do the rescaling after calling the base-class implementation. Luigi -- I'd never join any club that would have the likes of me as a member. -- Groucho Marx ------------------------------------------------------------------------------ Gaining the trust of online customers is vital for the success of any company that requires sensitive data to be transmitted over the Web. Learn how to best implement a security strategy that keeps consumers' information secure and instills the confidence they need to proceed with transactions. http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by Leon Sit
Hi Leon, I've added an inflation-lined bond into the QL trunk, as CPIbond in ql/instruments/bonds/cpibond.cpp. If you look at the new test inflationcpiswap.cpp you'll see how it works - all comments/suggestions welcome. I've also added some other CPI-linked functionality e.g. CPI-swaps and a CPICapFloor Instrument (test is in inflationcpicapfloor.cpp). Regards, Chris On Thu, 2011-01-06 at 15:00 -0600, Leon Sit wrote: >> I am trying to implement Inflation Linked Gilt. Is there a general >> advice on what part of quantlib I can reuse? I think I can probably >> reuse InflationTermStructurem, InflationIndex, and Bond. Any >> implementation advice? >You'll probably want to inherit a class from Coupon that takes an >InflationIndex and uses it to implement its rate() and accruedAmount() >methods (possibly a ZeroInflationIndex. I find it easier to cope with; >the YoYInflationIndex is a bit more quirky about retrieving fixings.) >Once you have the coupon, you can inherit a class from Bond. The >constructor will assemble the correct cash flows. If you're lucky, that >would be all; if instead your bond price must be rescaled by some >inflation factor, you'll have to put that calculation somewhere. You >might override performCalculation to do the rescaling after calling the >base-class implementation. >Luigi ------------------------------------------------------------------------------ Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Thanks tons! I will look into it and let you know.
I was implementing it for gilt and the day counting convention was terribly confusing. Leon On Sun, Jan 16, 2011 at 2:20 PM, Chris Kenyon <[hidden email]> wrote: > Hi Leon, > > I've added an inflation-lined bond into the QL trunk, as CPIbond in > ql/instruments/bonds/cpibond.cpp. > > If you look at the new test inflationcpiswap.cpp you'll see how it works - > all comments/suggestions welcome. > > I've also added some other CPI-linked functionality e.g. CPI-swaps and a > CPICapFloor Instrument (test is in inflationcpicapfloor.cpp). > > Regards, > > Chris > > On Thu, 2011-01-06 at 15:00 -0600, Leon Sit wrote: >>> I am trying to implement Inflation Linked Gilt. Is there a general >>> advice on what part of quantlib I can reuse? I think I can probably >>> reuse InflationTermStructurem, InflationIndex, and Bond. Any > >>> implementation advice? > >>You'll probably want to inherit a class from Coupon that takes an >>InflationIndex and uses it to implement its rate() and accruedAmount() >>methods (possibly a ZeroInflationIndex. I find it easier to cope with; >>the YoYInflationIndex is a bit more quirky about retrieving fixings.) > >>Once you have the coupon, you can inherit a class from Bond. The >>constructor will assemble the correct cash flows. If you're lucky, that >>would be all; if instead your bond price must be rescaled by some >>inflation factor, you'll have to put that calculation somewhere. You >>might override performCalculation to do the rescaling after calling the >>base-class implementation. > >>Luigi > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > > ------------------------------------------------------------------------------ Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |