Re: Vasicek 1Factor Model

Posted by newbie73 on
URL: http://quantlib.414.s1.nabble.com/Vasicek-1Factor-Model-tp1349p1351.html


I have added a definition similar to the HullWhite definition, but Vasicek(...) cannot be found in the QuantLib namespace.  The code I added to shortratemodels.i is below:

%{
        using QuantLib::Vasicek;
        typedef boost::shared_ptr<ShortRateModel> VasicekPtr;
%}


%rename(Vasicek) VasicekPtr;
class VasicekPtr : public boost::shared_ptr<ShortRateModel> {
  public:
    %extend
    {
        VasicekPtr( Rate r0 = 0.05,
                                        Real a = 0.1,
                                        Real b = 0.05,
                                        Real sigma = 0.01,
                                        Real lambda = 0.0);
        {
                        return new VasicekPtr(new HullWhite(r0, a, b, sigma, lambda));
                }
                DiscountFactor discount(Time t) const
                {
                        return boost::dynamic_pointer_cast<Vasicek>(*self)->discount(t);
                }
    }
};

---------------------------------------------------
No, I think it's just not exported. You can modify the relevant SWIG
interface file (shortratemodels.i) and add it---just clone what is done
for the other models.

Later,
        Luigi


--

This gubblick contains many nonsklarkish English flutzpahs, but the
overall pluggandisp can be glorked from context.
-- David Moser



-------------------------------------------------------------------------
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
QuantLib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/quantlib-users