QuantLib
: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
ql
models
equity
piecewisetimedependenthestonmodel.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) 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
20
/*! \file piecewisetimedependenthestonmodel.hpp
21
\brief piecewise constant time dependent Heston-model
22
*/
23
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
30
namespace
QuantLib
{
31
32
//! Piecewise time dependent Heston model
33
/*! References:
34
35
Heston, Steven L., 1993. A Closed-Form Solution for Options
36
with Stochastic Volatility with Applications to Bond and
37
Currency Options. The review of Financial Studies, Volume 6,
38
Issue 2, 327-343.
39
40
A. Elices, Models with time-dependent parameters using
41
transform methods: application to Heston’s model,
42
http://arxiv.org/pdf/0708.2020
43
*/
44
class
PiecewiseTimeDependentHestonModel
:
public
CalibratedModel
{
45
public
:
46
PiecewiseTimeDependentHestonModel
(
const
Handle<YieldTermStructure>
&
riskFreeRate
,
47
const
Handle<YieldTermStructure>
&
dividendYield
,
48
const
Handle<Quote>
&
s0
,
49
Real
v0
,
50
const
Parameter
&
theta
,
51
const
Parameter
&
kappa
,
52
const
Parameter
&
sigma
,
53
const
Parameter
&
rho
,
54
TimeGrid
timeGrid
);
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
;
71
const
Handle<YieldTermStructure>
&
dividendYield
()
const
;
72
const
Handle<YieldTermStructure>
&
riskFreeRate
()
const
;
73
74
protected
:
75
const
Handle<Quote>
s0_
;
76
const
Handle<YieldTermStructure>
riskFreeRate_
;
77
const
Handle<YieldTermStructure>
dividendYield_
;
78
const
TimeGrid
timeGrid_
;
79
};
80
}
81
82
83
#endif
84
QuantLib::CalibratedModel
Calibrated model class.
Definition:
model.hpp:86
QuantLib::CalibratedModel::arguments_
std::vector< Parameter > arguments_
Definition:
model.hpp:126
QuantLib::Handle
Shared handle to an observable.
Definition:
handle.hpp:41
QuantLib::Parameter
Base class for model arguments.
Definition:
parameter.hpp:38
QuantLib::PiecewiseTimeDependentHestonModel
Piecewise time dependent Heston model.
Definition:
piecewisetimedependenthestonmodel.hpp:44
QuantLib::PiecewiseTimeDependentHestonModel::rho
Real rho(Time t) const
Definition:
piecewisetimedependenthestonmodel.hpp:63
QuantLib::PiecewiseTimeDependentHestonModel::s0
Real s0() const
Definition:
piecewisetimedependenthestonmodel.hpp:67
QuantLib::PiecewiseTimeDependentHestonModel::dividendYield
const Handle< YieldTermStructure > & dividendYield() const
Definition:
piecewisetimedependenthestonmodel.cpp:55
QuantLib::PiecewiseTimeDependentHestonModel::timeGrid_
const TimeGrid timeGrid_
Definition:
piecewisetimedependenthestonmodel.hpp:78
QuantLib::PiecewiseTimeDependentHestonModel::theta
Real theta(Time t) const
Definition:
piecewisetimedependenthestonmodel.hpp:57
QuantLib::PiecewiseTimeDependentHestonModel::dividendYield_
const Handle< YieldTermStructure > dividendYield_
Definition:
piecewisetimedependenthestonmodel.hpp:77
QuantLib::PiecewiseTimeDependentHestonModel::v0
Real v0() const
Definition:
piecewisetimedependenthestonmodel.hpp:65
QuantLib::PiecewiseTimeDependentHestonModel::timeGrid
const TimeGrid & timeGrid() const
Definition:
piecewisetimedependenthestonmodel.cpp:50
QuantLib::PiecewiseTimeDependentHestonModel::sigma
Real sigma(Time t) const
Definition:
piecewisetimedependenthestonmodel.hpp:61
QuantLib::PiecewiseTimeDependentHestonModel::s0_
const Handle< Quote > s0_
Definition:
piecewisetimedependenthestonmodel.hpp:75
QuantLib::PiecewiseTimeDependentHestonModel::kappa
Real kappa(Time t) const
Definition:
piecewisetimedependenthestonmodel.hpp:59
QuantLib::PiecewiseTimeDependentHestonModel::riskFreeRate_
const Handle< YieldTermStructure > riskFreeRate_
Definition:
piecewisetimedependenthestonmodel.hpp:76
QuantLib::PiecewiseTimeDependentHestonModel::riskFreeRate
const Handle< YieldTermStructure > & riskFreeRate() const
Definition:
piecewisetimedependenthestonmodel.cpp:60
QuantLib::TimeGrid
time grid class
Definition:
timegrid.hpp:43
t
const DefaultType & t
Definition:
defaultprobabilitykey.cpp:39
QuantLib::Time
Real Time
continuous quantity with 1-year units
Definition:
types.hpp:62
QuantLib::Real
QL_REAL Real
real number
Definition:
types.hpp:50
kappa
Real kappa
Definition:
hestonrndcalculator.cpp:36
theta
Real theta
Definition:
hestonrndcalculator.cpp:36
rho
Real rho
Definition:
hestonrndcalculator.cpp:36
sigma
Real sigma
Definition:
hestonrndcalculator.cpp:36
model.hpp
Abstract interest rate model class.
QuantLib
Definition:
any.hpp:35
timegrid.hpp
discrete time grid
Generated by
Doxygen
1.9.5