27 Size integrationOrder)
33 Real relTolerance,
Size maxEvaluations)
37 relTolerance,
Null<
Real>(), maxEvaluations)) { }
42 ext::shared_ptr<BatesModel> batesModel =
43 ext::dynamic_pointer_cast<BatesModel>(*
model_);
45 const Real nu_ = batesModel->nu();
46 const Real delta2_ = 0.5*batesModel->delta()*batesModel->delta();
47 const Real lambda_ = batesModel->lambda();
48 const Real i = (j == 1)? 1.0 : 0.0;
49 const std::complex<Real> g(i, phi);
52 return t*lambda_*(std::exp(
nu_*g + delta2_*g*g) - 1.0
53 -g*(std::exp(
nu_+delta2_) - 1.0));
58 const ext::shared_ptr<BatesDetJumpModel>& model,
59 Size integrationOrder)
63 const ext::shared_ptr<BatesDetJumpModel>& model,
64 Real relTolerance,
Size maxEvaluations)
65 :
BatesEngine(model, relTolerance, maxEvaluations) { }
70 const std::complex<Real> l =
73 ext::shared_ptr<BatesDetJumpModel> batesDetJumpModel =
74 ext::dynamic_pointer_cast<BatesDetJumpModel>(*
model_);
76 const Real lambda = batesDetJumpModel->lambda();
77 const Real kappaLambda = batesDetJumpModel->kappaLambda();
78 const Real thetaLambda = batesDetJumpModel->thetaLambda();
80 return (kappaLambda*
t - 1.0 + std::exp(-kappaLambda*
t))
81 * thetaLambda*l/(kappaLambda*
t*lambda)
82 + (1.0 - std::exp(-kappaLambda*
t))*l/(kappaLambda*
t);
87 const ext::shared_ptr<BatesDoubleExpModel> & model,
88 Size integrationOrder)
94 const ext::shared_ptr<BatesDoubleExpModel>& model,
95 Real relTolerance,
Size maxEvaluations)
99 relTolerance,
Null<
Real>(), maxEvaluations)) { }
103 ext::shared_ptr<BatesDoubleExpModel> batesDoubleExpModel =
104 ext::dynamic_pointer_cast<BatesDoubleExpModel>(*
model_);
106 const Real p_ = batesDoubleExpModel->p();
108 const Real nuDown_= batesDoubleExpModel->nuDown();
109 const Real nuUp_ = batesDoubleExpModel->nuUp();
110 const Real lambda_= batesDoubleExpModel->lambda();
111 const Real i = (j == 1)? 1.0 : 0.0;
112 const std::complex<Real> g(i, phi);
114 return t*lambda_*(
p_/(1.0-g*nuUp_) + q_/(1.0+g*nuDown_) - 1.0
115 - g*(
p_/(1-nuUp_) + q_/(1+nuDown_)-1));
119 const ext::shared_ptr<BatesDoubleExpDetJumpModel> & model,
120 Size integrationOrder)
124 const ext::shared_ptr<BatesDoubleExpDetJumpModel>& model,
125 Real relTolerance,
Size maxEvaluations)
130 const std::complex<Real> l =
133 ext::shared_ptr<BatesDoubleExpDetJumpModel> doubleExpDetJumpModel
134 = ext::dynamic_pointer_cast<BatesDoubleExpDetJumpModel>(*
model_);
136 const Real lambda = doubleExpDetJumpModel->lambda();
137 const Real kappaLambda = doubleExpDetJumpModel->kappaLambda();
138 const Real thetaLambda = doubleExpDetJumpModel->thetaLambda();
140 return (kappaLambda*
t - 1.0 + std::exp(-kappaLambda*
t))
141 * thetaLambda*l/(kappaLambda*
t*lambda)
142 + (1.0 - std::exp(-kappaLambda*
t))*l/(kappaLambda*
t);
analytic Bates model engine
analytic Heston-model engine based on Fourier transform
std::complex< Real > addOnTerm(Real phi, Time t, Size j) const override
BatesDetJumpEngine(const ext::shared_ptr< BatesDetJumpModel > &model, Size integrationOrder=144)
BatesDoubleExpDetJumpEngine(const ext::shared_ptr< BatesDoubleExpDetJumpModel > &model, Size integrationOrder=144)
std::complex< Real > addOnTerm(Real phi, Time t, Size j) const override
BatesDoubleExpEngine(const ext::shared_ptr< BatesDoubleExpModel > &model, Size integrationOrder=144)
std::complex< Real > addOnTerm(Real phi, Time t, Size j) const override
Bates model engines based on Fourier transform.
std::complex< Real > addOnTerm(Real phi, Time t, Size j) const override
BatesEngine(const ext::shared_ptr< BatesModel > &model, Size integrationOrder=144)
Handle< HestonModel > model_
template class providing a null value for a given type.
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
Payoffs for various options.