I am trying to add the Piecewise heston model and have the following SWIG code. But the Parameter type isn't currently working can someone give me a hand on this?
%{ using QuantLib::CalibratedModel; using QuantLib::TimeGrid; using QuantLib::Parameter; using QuantLib::PiecewiseTimeDependentHestonModel; typedef boost::shared_ptr<CalibratedModel> PiecewiseTimeDependentHestonModelPtr; %} %rename(PiecewiseTimeDependentHestonModel) PiecewiseTimeDependentHestonModelPtr; class PiecewiseTimeDependentHestonModelPtr : public boost::shared_ptr<CalibratedModel> { public: %extend { PiecewiseTimeDependentHestonModelPtr(const Handle<YieldTermStructure>& riskFreeTS, const Handle<YieldTermStructure>& dividendTS, const Handle<Quote>& s0, Real v0, const Parameter& theta, const Parameter& kappa, const Parameter& sigma, const Parameter& rho, const TimeGrid& timeGrid) { return new PiecewiseTimeDependentHestonModelPtr( new PiecewiseTimeDependentHestonModel(riskFreeTS, dividendTS, s0, v0, theta, kappa, sigma, rho, timeGrid)); } } }; |
I would guess you have to wrap the Parameter class before the model.
Are you doing this? If so, what is the error you're getting? Luigi On Sat, Mar 31, 2012 at 10:24 PM, Kiwiabove <[hidden email]> wrote: > > I am trying to add the Piecewise heston model and have the following SWIG > code. But the Parameter type isn't currently working can someone give me a > hand on this? > > %{ > using QuantLib::CalibratedModel; > using QuantLib::TimeGrid; > using QuantLib::Parameter; > using QuantLib::PiecewiseTimeDependentHestonModel; > typedef boost::shared_ptr<CalibratedModel> > PiecewiseTimeDependentHestonModelPtr; > %} > %rename(PiecewiseTimeDependentHestonModel) > PiecewiseTimeDependentHestonModelPtr; > class PiecewiseTimeDependentHestonModelPtr : public > boost::shared_ptr<CalibratedModel> { > public: > %extend { > PiecewiseTimeDependentHestonModelPtr(const Handle<YieldTermStructure>& > riskFreeTS, > const Handle<YieldTermStructure>& dividendTS, > const Handle& s0, > Real v0, const Parameter& theta, > const Parameter& kappa, const Parameter& sigma, const > Parameter& rho, const TimeGrid& timeGrid) > { > return new PiecewiseTimeDependentHestonModelPtr( > new PiecewiseTimeDependentHestonModel(riskFreeTS, dividendTS, s0, v0, > theta, kappa, sigma, rho, timeGrid)); > } > > } > }; > -- > View this message in context: http://old.nabble.com/Trying-to-add-SWIG-for-PieceWiseHeston-tp33544957p33544957.html > Sent from the quantlib-users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > This SF email is sponsosred by: > Try Windows Azure free for 90 days Click Here > http://p.sf.net/sfu/sfd2d-msazure > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users ------------------------------------------------------------------------------ Better than sec? Nothing is better than sec when it comes to monitoring Big Data applications. Try Boundary one-second resolution app monitoring today. Free. http://p.sf.net/sfu/Boundary-dev2dev _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |