예제 #1
0
        public HybridHestonHullWhiteProcess(HestonProcess hestonProcess,
                                            HullWhiteForwardProcess hullWhiteProcess,
                                            double corrEquityShortRate,
                                            Discretization discretization = Discretization.BSMHullWhite)
        {
            hestonProcess_    = hestonProcess;
            hullWhiteProcess_ = hullWhiteProcess;
            hullWhiteModel_   = new HullWhite(hestonProcess.riskFreeRate(),
                                              hullWhiteProcess.a(),
                                              hullWhiteProcess.sigma());
            corrEquityShortRate_ = corrEquityShortRate;
            disc_   = discretization;
            maxRho_ = Math.Sqrt(1 - hestonProcess.rho() * hestonProcess.rho())
                      - Math.Sqrt(Const.QL_EPSILON) /* reserve for rounding errors */;

            T_           = hullWhiteProcess.getForwardMeasureTime();
            endDiscount_ = hestonProcess.riskFreeRate().link.discount(T_);

            Utils.QL_REQUIRE(corrEquityShortRate * corrEquityShortRate
                             + hestonProcess.rho() * hestonProcess.rho() <= 1.0, () =>
                             "correlation matrix is not positive definite");

            Utils.QL_REQUIRE(hullWhiteProcess.sigma() > 0.0, () =>
                             "positive vol of Hull White process is required");
        }
예제 #2
0
        public HestonModel(HestonProcess process)
            : base(5)
        {
            process_ = process;

            arguments_[0] = new ConstantParameter(process.theta(), new PositiveConstraint());
            arguments_[1] = new ConstantParameter(process.kappa(), new PositiveConstraint());
            arguments_[2] = new ConstantParameter(process.sigma(), new PositiveConstraint());
            arguments_[3] = new ConstantParameter(process.rho(), new BoundaryConstraint(-1.0, 1.0));
            arguments_[4] = new ConstantParameter(process.v0(), new PositiveConstraint());
            generateArguments();

            process_.riskFreeRate().registerWith(update);
            process_.dividendYield().registerWith(update);
            process_.s0().registerWith(update);
        }
예제 #3
0
        public FdmHestonOp(FdmMesher mesher,
                           HestonProcess hestonProcess,
                           FdmQuantoHelper quantoHelper      = null,
                           LocalVolTermStructure leverageFct = null)
        {
            correlationMap_ = new SecondOrderMixedDerivativeOp(0, 1, mesher)
                              .mult(hestonProcess.rho() * hestonProcess.sigma()
                                    * mesher.locations(1));

            dyMap_ = new FdmHestonVariancePart(mesher,
                                               hestonProcess.riskFreeRate().currentLink(),
                                               hestonProcess.sigma(),
                                               hestonProcess.kappa(),
                                               hestonProcess.theta());
            dxMap_ = new FdmHestonEquityPart(mesher,
                                             hestonProcess.riskFreeRate().currentLink(),
                                             hestonProcess.dividendYield().currentLink(),
                                             quantoHelper,
                                             leverageFct);
        }