25#ifndef quantlib_analytic_heston_engine_hpp
26#define quantlib_analytic_heston_engine_hpp
93 VanillaOption::arguments,
94 VanillaOption::results> {
126 Real relTolerance,
Size maxEvaluations);
131 Size integrationOrder = 144);
137 Real andersenPiterbargEpsilon = 1e-25,
143 std::complex<Real>
chF(
const std::complex<Real>& z,
Time t)
const;
144 std::complex<Real>
lnChF(
const std::complex<Real>& z,
Time t)
const;
148 [[deprecated(
"Use AnalyticHestonEngine::priceVanillaPayoff instead.")]]
150 Real dividendDiscount,
160 const Integration& integration,
167 const ext::shared_ptr<PlainVanillaPayoff>&
payoff,
168 const Date& maturity)
const;
171 const ext::shared_ptr<PlainVanillaPayoff>&
payoff,
Time maturity)
const;
187 const ext::shared_ptr<PlainVanillaPayoff>&
payoff,
211 Size maxEvaluations = 1000,
212 bool useConvergenceEstimate =
false);
216 Size maxEvaluations = 1000);
218 Size maxEvaluations = 1000);
220 Size maxEvaluations = 1000);
230 const ext::function<
Real()>& maxBound = {},
231 Real scaling = 1.0)
const;
235 Real maxBound)
const;
309 return std::complex<Real>(0,0);
std::complex< Real > psi_
Real controlVariateValue() const
std::complex< Real > phi_
Real operator()(Real u) const
const ComplexLogFormula cpxLog_
const AnalyticHestonEngine *const enginePtr_
static Real andersenPiterbargIntegrationLimit(Real c_inf, Real epsilon, Real v0, Real t)
Size numberOfEvaluations() const
bool isAdaptiveIntegration() const
static Integration discreteSimpson(Size evaluation=1000)
static Integration gaussChebyshev2nd(Size integrationOrder=128)
static Integration simpson(Real absTolerance, Size maxEvaluations=1000)
const ext::shared_ptr< GaussianQuadrature > gaussianQuadrature_
static Integration gaussLegendre(Size integrationOrder=128)
static Integration gaussLobatto(Real relTolerance, Real absTolerance, Size maxEvaluations=1000, bool useConvergenceEstimate=false)
static Integration gaussChebyshev(Size integrationOrder=128)
static Integration expSinh(Real relTolerance=1e-8)
static Integration trapezoid(Real absTolerance, Size maxEvaluations=1000)
static Integration gaussLaguerre(Size integrationOrder=128)
static Integration gaussKronrod(Real absTolerance, Size maxEvaluations=1000)
const ext::shared_ptr< Integrator > integrator_
static Integration discreteTrapezoid(Size evaluation=1000)
std::pair< Real, Real > alphaGreaterZero(Real strike) const
Size numberOfEvaluations() const
std::pair< Real, Real > alphaSmallerMinusOne(Real strike) const
Real alphaMax(Real strike) const
Real k(Real x, Integer sgn) const
Real alphaMin(Real strike) const
std::pair< Real, Real > findMinima(Real lower, Real upper, Real strike) const
Real operator()(Real strike) const
const AnalyticHestonEngine *const enginePtr_
analytic Heston-model engine based on Fourier transform
const Real andersenPiterbargEpsilon_
Size numberOfEvaluations() const
std::complex< Real > lnChF(const std::complex< Real > &z, Time t) const
static void doCalculation(Real riskFreeDiscount, Real dividendDiscount, Real spotPrice, Real strikePrice, Real term, Real kappa, Real theta, Real sigma, Real v0, Real rho, const TypePayoff &type, const Integration &integration, ComplexLogFormula cpxLog, const AnalyticHestonEngine *enginePtr, Real &value, Size &evaluations)
void calculate() const override
Real priceVanillaPayoff(const ext::shared_ptr< PlainVanillaPayoff > &payoff, const Date &maturity) const
const ComplexLogFormula cpxLog_
const ext::shared_ptr< Integration > integration_
std::complex< Real > chF(const std::complex< Real > &z, Time t) const
virtual std::complex< Real > addOnTerm(Real phi, Time t, Size j) const
static ComplexLogFormula optimalControlVariate(Time t, Real v0, Real kappa, Real theta, Real sigma, Real rho)
Base class for some pricing engine on a particular model.
Intermediate class for put/call payoffs.
Maps function, bind and cref to either the boost or std implementation.
Integral of a 1-dimensional function using the Gauss quadratures.
Generic option engine based on a model.
Real Time
continuous quantity with 1-year units
QL_INTEGER Integer
integer number
std::size_t Size
size of a container
Heston model for the stochastic volatility of an asset.
Integrators base class definition.
ext::shared_ptr< QuantLib::Payoff > payoff
Vanilla option on a single asset.