QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
hestonslvfdmmodel.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) 2015 Johannes Göttker-Schnetmann
5 Copyright (C) 2015 Klaus Spanderen
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
21/*! \file hestonslvfdmmodel.hpp
22 \brief Heston stochastic local volatility model
23*/
24
25#ifndef quantlib_heston_slv_model_hpp
26#define quantlib_heston_slv_model_hpp
27
28#include <ql/handle.hpp>
34
35#include <list>
36
37namespace QuantLib {
38
39class SimpleQuote;
40 class HestonModel;
41 class LocalVolTermStructure;
42
47
48 // Rannacher smoothing steps at the beginning
50
52
53 // local volatility forward equation
57
58 // variance mesher definition
61
62 // do not calculate leverage function if prob is smaller than eps
64
65 // algorithm to get to the start configuration at time point one
68
69 // define finite difference scheme
71 };
72
74 public:
76 Handle<HestonModel> hestonModel,
77 const Date& endDate,
79 bool logging = false,
80 std::vector<Date> mandatoryDates = std::vector<Date>(),
81 Real mixingFactor = 1.0);
82
83 ext::shared_ptr<HestonProcess> hestonProcess() const;
84 ext::shared_ptr<LocalVolTermStructure> localVol() const;
85 ext::shared_ptr<LocalVolTermStructure> leverageFunction() const;
86
87 struct LogEntry {
88 const Time t;
89 const ext::shared_ptr<Array> prob;
90 const ext::shared_ptr<FdmMesherComposite> mesher;
91 };
92
93 const std::list<LogEntry>& logEntries() const;
94
95 protected:
96 void performCalculations() const override;
97
102 const std::vector<Date> mandatoryDates_;
104
105 mutable ext::shared_ptr<LocalVolTermStructure> leverageFunction_;
106
107 const bool logging_;
108 mutable std::list<LogEntry> logEntries_;
109 };
110}
111
112
113#endif
114
Concrete date class.
Definition: date.hpp:125
Shared handle to an observable.
Definition: handle.hpp:41
ext::shared_ptr< LocalVolTermStructure > leverageFunction() const
void performCalculations() const override
const std::list< LogEntry > & logEntries() const
const HestonSLVFokkerPlanckFdmParams params_
ext::shared_ptr< LocalVolTermStructure > leverageFunction_
std::list< LogEntry > logEntries_
const Handle< LocalVolTermStructure > localVol_
const Handle< HestonModel > hestonModel_
const std::vector< Date > mandatoryDates_
ext::shared_ptr< HestonProcess > hestonProcess() const
ext::shared_ptr< LocalVolTermStructure > localVol() const
Framework for calculation on demand and result caching.
Definition: lazyobject.hpp:35
Heston Fokker-Planck Green's function.
FdmMesher which is a composite of Fdm1dMesher.
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
Globally accessible relinkable pointer.
framework for calculation on demand and result caching
Definition: any.hpp:35
observer/observable pattern
const ext::shared_ptr< FdmMesherComposite > mesher
const Time t
const ext::shared_ptr< Array > prob
FdmSquareRootFwdOp::TransformationType trafoType
FdmHestonGreensFct::Algorithm greensAlgorithm