Trying to add SWIG for PieceWiseHeston

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Trying to add SWIG for PieceWiseHeston

Kiwiabove
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));
                                           }

        }
};
Reply | Threaded
Open this post in threaded view
|

Re: Trying to add SWIG for PieceWiseHeston

Luigi Ballabio
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