33 Size maxIntegrationIterations)
34 : maxIntegrationIterations_(maxIntegrationIterations), integrationEps_(integrationEps_),
35 model_(
std::move(model)) {}
40 "not an European option");
42 const ext::shared_ptr<HestonProcess>& process =
model_->process();
46 const Real xMax = 8.0 * std::sqrt(process->theta()*
t
47 + (process->v0() - process->theta())
48 *(1-std::exp(-process->kappa()*
t))/process->kappa());
50 const Real x0 = std::log(process->s0()->value());
51 const Real rD = process->riskFreeRate()->discount(
t);
52 const Real qD = process->dividendYield()->discount(
t);
54 const Real drift = x0 + std::log(rD/qD);
58 -xMax+drift, xMax+drift);
68 const Real x_t = std::log(
s);
76 =
model_->process()->riskFreeRate()->discount(
t);
78 const Real s_t = std::exp(x_t);
Analytic engine for arbitrary European payoffs under the Heston model.
Real cdf(Real X, Time t) const
AnalyticPDFHestonEngine(ext::shared_ptr< HestonModel > model, Real gaussLobattoEps=1e-6, Size gaussLobattoIntegrationOrder=10000UL)
void calculate() const override
const Real integrationEps_
Real Pv(Real x_t, Time t) const
const Size maxIntegrationIterations_
const ext::shared_ptr< HestonModel > model_
Real weightedPayoff(Real x_t, Time t) const
Integral of a one-dimensional function.
Risk neutral terminal probability density for the Heston model.
Real pdf(Real x, Time t) const override
Real cdf(Real x, Time t) const override
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
integral of a one-dimensional function using the adaptive Gauss-Lobatto integral
Real Time
continuous quantity with 1-year units
Real DiscountFactor
discount factor between dates
std::size_t Size
size of a container
risk neutral terminal density calculator for the Heston stochastic volatility model
ext::shared_ptr< QuantLib::Payoff > payoff