QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
analytich1hwengine.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2012 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
20/*! \file analytich1hwengine.hpp
21 \brief analytic Heston-Hull-White engine based on the H1-HW approximation
22*/
23
24#ifndef quantlib_analytic_h1_hw_engine_hpp
25#define quantlib_analytic_h1_hw_engine_hpp
26
30
31namespace QuantLib {
32
33 //! Analytic Heston-Hull-White engine based on the H1-HW approximation
34 /*! This class is pricing a european option under the following process
35
36 \f[
37 \begin{array}{rcl}
38 dS(t, S) &=& (r-d) S dt +\sqrt{v} S dW_1 \\
39 dv(t, S) &=& \kappa (\theta - v) dt + \sigma \sqrt{v} dW_2 \\
40 dr(t) &=& (\theta(t) - a r) dt + \eta dW_3 \\
41 dW_1 dW_2 &=& \rho_{S,v} dt, \rho_{S,r} >= 0 \\
42 dW_1 dW_3 &=& \rho_{S.r} dt \\
43 dW_2 dW_3 &=& 0 dt \\
44 \end{array}
45 \f]
46 */
47
48 /*! References:
49
50 Lech A. Grzelak, Cornelis W. Oosterlee,
51 On The Heston Model with Stochastic,
52 http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1382902
53
54 Lech A. Grzelak,
55 Equity and Foreign Exchange Hybrid Models for
56 Pricing Long-Maturity Financial Derivatives,
57 http://repository.tudelft.nl/assets/uuid:a8e1a007-bd89-481a-aee3-0e22f15ade6b/PhDThesis_main.pdf
58
59 \ingroup vanillaengines
60
61 \test the correctness of the returned value is tested by
62 reproducing results available in web/literature, testing
63 against QuantLib's analytic Heston,
64 the Black-Scholes-Merton Hull-White engine and
65 the finite difference Heston-Hull-White engine
66 */
67
69 public:
70 AnalyticH1HWEngine(const ext::shared_ptr<HestonModel>& model,
71 const ext::shared_ptr<HullWhite>& hullWhiteModel,
72 Real rhoSr, Size integrationOrder = 144);
73
74 AnalyticH1HWEngine(const ext::shared_ptr<HestonModel>& model,
75 const ext::shared_ptr<HullWhite>& hullWhiteModel,
76 Real rhoSr, Real relTolerance, Size maxEvaluations);
77
78 protected:
79 std::complex<Real> addOnTerm(Real phi, Time t, Size j) const override;
80
81 private:
82 class Fj_Helper;
83
84 const Real rhoSr_;
85 };
86}
87
88#endif
analytic heston engine incl. stochastic interest rates
Analytic Heston-Hull-White engine based on the H1-HW approximation.
std::complex< Real > addOnTerm(Real phi, Time t, Size j) const override
Analytic Heston engine incl. stochastic interest rates.
const DefaultType & t
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
Heston model for the stochastic volatility of an asset.
Hull & White (HW) model.
Definition: any.hpp:35