Re: Inflation Linked Gilt

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Inflation-Linked-Gilt-tp1307p1310.html

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