QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
analytichestonhullwhiteengine.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2007 Klaus Spanderen
5 Copyright (C) 2007 StatPro Italia srl
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
25#ifndef quantlib_analytic_heston_hull_white_engine_hpp
26#define quantlib_analytic_heston_hull_white_engine_hpp
27
28#include <ql/models/equity/hestonmodel.hpp>
29#include <ql/models/shortrate/onefactormodels/hullwhite.hpp>
30#include <ql/pricingengines/vanilla/analytichestonengine.hpp>
31
32namespace QuantLib {
33
35
66 public:
67 // see AnalticHestonEninge for usage of different constructors
68 AnalyticHestonHullWhiteEngine(const ext::shared_ptr<HestonModel>& hestonModel,
69 ext::shared_ptr<HullWhite> hullWhiteModel,
70 Size integrationOrder = 144);
71
72 AnalyticHestonHullWhiteEngine(const ext::shared_ptr<HestonModel>& model,
73 ext::shared_ptr<HullWhite> hullWhiteModel,
74 Real relTolerance,
75 Size maxEvaluations);
76
77
78 void update() override;
79 void calculate() const override;
80
81 protected:
82 std::complex<Real> addOnTerm(Real phi, Time t, Size j) const override;
83
84 const ext::shared_ptr<HullWhite> hullWhiteModel_;
85
86 private:
87 void setParameters();
88 mutable Real m_;
89 mutable Real a_, sigma_;
90 };
91
92 inline
94 Time,
95 Size j) const {
96 return std::complex<Real>(-m_*u*u, u*(m_-2*m_*(j-1)));
97 }
98
99}
100
101#endif
analytic Heston-model engine based on Fourier transform
Analytic Heston engine incl. stochastic interest rates.
std::complex< Real > addOnTerm(Real phi, Time t, Size j) const override
const ext::shared_ptr< HullWhite > hullWhiteModel_
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