QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
piecewisetimedependenthestonmodel.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2010 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_piecewise_time_dependent_heston_model_hpp
25#define quantlib_piecewise_time_dependent_heston_model_hpp
26
27#include <ql/timegrid.hpp>
28#include <ql/models/model.hpp>
29
30namespace QuantLib {
31
33
45 public:
48 const Handle<Quote>& s0,
49 Real v0,
50 const Parameter& theta,
51 const Parameter& kappa,
52 const Parameter& sigma,
53 const Parameter& rho,
55
56 // variance mean version level
57 Real theta(Time t) const { return arguments_[0](t); }
58 // variance mean reversion speed
59 Real kappa(Time t) const { return arguments_[1](t); }
60 // volatility of the volatility
61 Real sigma(Time t) const { return arguments_[2](t); }
62 // correlation
63 Real rho(Time t) const { return arguments_[3](t); }
64 // spot variance
65 Real v0() const { return arguments_[4](0.0); }
66 // spot
67 Real s0() const { return s0_->value(); }
68
69
70 const TimeGrid& timeGrid() const;
73
74 protected:
79 };
80}
81
82
83#endif
84
Calibrated model class.
Definition: model.hpp:86
std::vector< Parameter > arguments_
Definition: model.hpp:126
Shared handle to an observable.
Definition: handle.hpp:41
Base class for model arguments.
Definition: parameter.hpp:38
const Handle< YieldTermStructure > & dividendYield() const
const Handle< YieldTermStructure > & riskFreeRate() const
time grid class
Definition: timegrid.hpp:43
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:35