QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
hestonslvfdmmodel.hpp
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
25#ifndef quantlib_heston_slv_model_hpp
26#define quantlib_heston_slv_model_hpp
27
28#include <ql/handle.hpp>
29#include <ql/patterns/lazyobject.hpp>
30#include <ql/patterns/observable.hpp>
31#include <ql/methods/finitedifferences/solvers/fdmbackwardsolver.hpp>
32#include <ql/methods/finitedifferences/meshers/fdmmeshercomposite.hpp>
33#include <ql/methods/finitedifferences/utilities/fdmhestongreensfct.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
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
const ext::shared_ptr< FdmMesherComposite > mesher
const Time t
const ext::shared_ptr< Array > prob
const FdmSquareRootFwdOp::TransformationType trafoType
const FdmHestonGreensFct::Algorithm greensAlgorithm