Login  Register

Re: Which methods to expose to access Discount/FwdRate?

Posted by Luigi Ballabio on Sep 17, 2007; 4:01pm
URL: http://quantlib.414.s1.nabble.com/Which-methods-to-expose-to-access-Discount-FwdRate-tp1361p1362.html

On Fri, 2007-09-14 at 17:50 -0700, newbie73 wrote:
> I want to use the Short Rate models to generate spot curves / forward curves
> in discount factors and also in yields.  Currently I am unable to access the
> discount function that is a part of the ShortRateTree class and the
> OneFactorAffineModel class.

Hi,
        those methods are not exported in the C# bindings (is that what you're
using, right?) In order to export them, you'll have to add them to the
SWIG interface files and regenerate the wrappers. For instance, you'll
have to go to the definition of the Hull-White model in
shortratemodels.i and add inside the %extend block the following:

DiscountFactor discount(Time t) const {
    return boost::dynamic_pointer_cast<HullWhite>(*self)->discount(t);
}

Luigi


--

The wisdom of the wise and the experience of the ages are perpetuated
by quotations.
-- Benjamin Disraeli



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users