Esempio n. 1
0
 public AnalyticH1HWEngine(HestonModel model, HullWhite hullWhiteModel, double rhoSr, int integrationOrder = 144)
     : base(model, hullWhiteModel, integrationOrder)
 {
     rhoSr_ = rhoSr;
     Utils.QL_REQUIRE(rhoSr_ >= 0.0, () => "Fourier integration is not stable if " +
                      "the equity interest rate correlation is negative");
 }
        public AnalyticHestonHullWhiteEngine(HestonModel hestonModel,
                                             HullWhite hullWhiteModel,
                                             double relTolerance, int maxEvaluations)
            : base(hestonModel, relTolerance, maxEvaluations)
        {
            hullWhiteModel_ = hullWhiteModel;

            update();
            hullWhiteModel_.registerWith(update);
        }
        // see AnalticHestonEninge for usage of different constructors
        public AnalyticHestonHullWhiteEngine(HestonModel hestonModel,
                                             HullWhite hullWhiteModel,
                                             int integrationOrder = 144)
            : base(hestonModel, integrationOrder)
        {
            hullWhiteModel_ = hullWhiteModel;

            update();
            hullWhiteModel_.registerWith(update);
        }
Esempio n. 4
0
        protected override IPricingEngine controlPricingEngine()
        {
            HybridHestonHullWhiteProcess process = process_ as HybridHestonHullWhiteProcess;

            Utils.QL_REQUIRE(process != null, () => "invalid process");

            HestonProcess hestonProcess = process.hestonProcess();

            HullWhiteForwardProcess hullWhiteProcess = process.hullWhiteProcess();

            HestonModel hestonModel = new HestonModel(hestonProcess);

            HullWhite hwModel = new HullWhite(hestonProcess.riskFreeRate(),
                                              hullWhiteProcess.a(),
                                              hullWhiteProcess.sigma());

            return(new AnalyticHestonHullWhiteEngine(hestonModel, hwModel, 144));
        }
Esempio n. 5
0
 public Fj_Helper(VanillaOption.Arguments arguments,
                  HestonModel model,
                  AnalyticHestonEngine engine,
                  ComplexLogFormula cpxLog,
                  double term, double ratio, int j)
 {
     j_      = j; //arg_(arguments),
     kappa_  = model.kappa();
     theta_  = model.theta();
     sigma_  = model.sigma();
     v0_     = model.v0();
     cpxLog_ = cpxLog;
     term_   = term;
     x_      = Math.Log(model.process().s0().link.value());
     sx_     = Math.Log(((StrikedTypePayoff)(arguments.payoff)).strike());
     dd_     = x_ - Math.Log(ratio);
     sigma2_ = sigma_ * sigma_;
     rsigma_ = model.rho() * sigma_;
     t0_     = kappa_ - ((j_ == 1) ? model.rho() * sigma_ : 0);
     b_      = 0;
     g_km1_  = 0;
     engine_ = engine;
 }
Esempio n. 6
0
 public AnalyticH1HWEngine(HestonModel model, HullWhite hullWhiteModel, double rhoSr, double relTolerance,
                           int maxEvaluations)
     : base(model, hullWhiteModel, relTolerance, maxEvaluations)
 {
     rhoSr_ = rhoSr;
 }