QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
analyticptdhestonengine.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2010, 2017 Klaus Spanderen
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
24#ifndef quantlib_analytic_piecewise_time_dependent_heston_engine_hpp
25#define quantlib_analytic_piecewise_time_dependent_heston_engine_hpp
26
27#include <ql/instruments/vanillaoption.hpp>
28#include <ql/pricingengines/vanilla/analytichestonengine.hpp>
29#include <ql/models/equity/piecewisetimedependenthestonmodel.hpp>
30
31
32namespace QuantLib {
33
35
53 : public GenericModelEngine<PiecewiseTimeDependentHestonModel,
54 VanillaOption::arguments,
55 VanillaOption::results> {
56 public:
59
60 // Simple to use constructor: Using adaptive
61 // Gauss-Lobatto integration and Gatheral's version of complex log.
62 // Be aware: using a too large number for maxEvaluations might result
63 // in a stack overflow as the Lobatto integration is a recursive
64 // algorithm.
66 const ext::shared_ptr<PiecewiseTimeDependentHestonModel>& model,
67 Real relTolerance, Size maxEvaluations);
68
69 // Constructor using Laguerre integration
70 // and Gatheral's version of complex log.
72 const ext::shared_ptr<PiecewiseTimeDependentHestonModel>& model,
73 Size integrationOrder = 144);
74
75 // Constructor giving full control over Fourier integration algorithm
77 const ext::shared_ptr<PiecewiseTimeDependentHestonModel>& model,
78 ComplexLogFormula cpxLog,
79 const Integration& itg,
80 Real andersenPiterbargEpsilon = 1e-8);
81
82
83 void calculate() const override;
85
86 // normalized characteristic function
87 std::complex<Real> chF(const std::complex<Real>& z, Time t) const;
88 std::complex<Real> lnChF(const std::complex<Real>& z, Time t) const;
89
90 private:
91 class Fj_Helper;
92 class AP_Helper;
93
96 const ext::shared_ptr<Integration> integration_;
98 };
99}
100
101#endif
analytic piecewise constant time dependent Heston-model engine
std::complex< Real > lnChF(const std::complex< Real > &z, Time t) const
AnalyticHestonEngine::Integration Integration
const ext::shared_ptr< Integration > integration_
std::complex< Real > chF(const std::complex< Real > &z, Time t) const
Base class for some pricing engine on a particular model.
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35