QuantLib
: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
ql
pricingengines
vanilla
analyticgjrgarchengine.hpp
1
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3
/*
4
Copyright (C) 2008 Yee Man Chan
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_analytic_gjrgarch_engine_hpp
25
#define quantlib_analytic_gjrgarch_engine_hpp
26
27
#include <ql/pricingengines/genericmodelengine.hpp>
28
#include <ql/models/equity/gjrgarchmodel.hpp>
29
#include <ql/instruments/vanillaoption.hpp>
30
#include <ql/math/integrals/gaussianquadratures.hpp>
31
#include <complex>
32
33
namespace
QuantLib
{
34
36
51
class
AnalyticGJRGARCHEngine
52
:
public
GenericModelEngine
<GJRGARCHModel,
53
VanillaOption::arguments,
54
VanillaOption::results> {
55
public
:
56
AnalyticGJRGARCHEngine
(
const
ext::shared_ptr<GJRGARCHModel>& model);
57
void
calculate
()
const override
;
58
// call back for extended stochastic volatility
59
// plus jump diffusion engines like bates model
60
private
:
61
// store parameters
62
mutable
bool
init_
;
63
mutable
Real
h1_
;
64
mutable
Real
b0_
;
65
mutable
Real
b1_
;
66
mutable
Real
b2_
;
67
mutable
Real
b3_
;
68
mutable
Real
la_
;
69
mutable
Real
r_
;
70
mutable
Size
T_
;
71
// intermediate constants determined by b1,b2,b3,la
72
mutable
Real
m1_
;
73
mutable
Real
m2_
;
74
mutable
Real
m3_
;
75
mutable
Real
v1_
;
76
mutable
Real
v2_
;
77
mutable
Real
v3_
;
78
mutable
Real
z1_
;
79
mutable
Real
z2_
;
80
mutable
Real
x1_
;
81
// statistical data for the GJR-GARCH process determined by
82
// h1,b0,b1,b2,b3,r,T
83
mutable
Real
ex_
;
// mean
84
mutable
Real
sigma_
;
// variance
85
mutable
Real
k3_
;
// skewness
86
mutable
Real
k4_
;
// kurtosis
87
};
88
89
}
90
91
#endif
QuantLib::AnalyticGJRGARCHEngine
GJR-GARCH(1,1) engine.
Definition:
analyticgjrgarchengine.hpp:54
QuantLib::AnalyticGJRGARCHEngine::x1_
Real x1_
Definition:
analyticgjrgarchengine.hpp:80
QuantLib::AnalyticGJRGARCHEngine::la_
Real la_
Definition:
analyticgjrgarchengine.hpp:68
QuantLib::AnalyticGJRGARCHEngine::b0_
Real b0_
Definition:
analyticgjrgarchengine.hpp:64
QuantLib::AnalyticGJRGARCHEngine::T_
Size T_
Definition:
analyticgjrgarchengine.hpp:70
QuantLib::AnalyticGJRGARCHEngine::v1_
Real v1_
Definition:
analyticgjrgarchengine.hpp:75
QuantLib::AnalyticGJRGARCHEngine::sigma_
Real sigma_
Definition:
analyticgjrgarchengine.hpp:84
QuantLib::AnalyticGJRGARCHEngine::h1_
Real h1_
Definition:
analyticgjrgarchengine.hpp:63
QuantLib::AnalyticGJRGARCHEngine::m3_
Real m3_
Definition:
analyticgjrgarchengine.hpp:74
QuantLib::AnalyticGJRGARCHEngine::b1_
Real b1_
Definition:
analyticgjrgarchengine.hpp:65
QuantLib::AnalyticGJRGARCHEngine::calculate
void calculate() const override
Definition:
analyticgjrgarchengine.cpp:42
QuantLib::AnalyticGJRGARCHEngine::b3_
Real b3_
Definition:
analyticgjrgarchengine.hpp:67
QuantLib::AnalyticGJRGARCHEngine::r_
Real r_
Definition:
analyticgjrgarchengine.hpp:69
QuantLib::AnalyticGJRGARCHEngine::v2_
Real v2_
Definition:
analyticgjrgarchengine.hpp:76
QuantLib::AnalyticGJRGARCHEngine::k3_
Real k3_
Definition:
analyticgjrgarchengine.hpp:85
QuantLib::AnalyticGJRGARCHEngine::z2_
Real z2_
Definition:
analyticgjrgarchengine.hpp:79
QuantLib::AnalyticGJRGARCHEngine::m1_
Real m1_
Definition:
analyticgjrgarchengine.hpp:72
QuantLib::AnalyticGJRGARCHEngine::b2_
Real b2_
Definition:
analyticgjrgarchengine.hpp:66
QuantLib::AnalyticGJRGARCHEngine::v3_
Real v3_
Definition:
analyticgjrgarchengine.hpp:77
QuantLib::AnalyticGJRGARCHEngine::ex_
Real ex_
Definition:
analyticgjrgarchengine.hpp:83
QuantLib::AnalyticGJRGARCHEngine::k4_
Real k4_
Definition:
analyticgjrgarchengine.hpp:86
QuantLib::AnalyticGJRGARCHEngine::z1_
Real z1_
Definition:
analyticgjrgarchengine.hpp:78
QuantLib::AnalyticGJRGARCHEngine::init_
bool init_
Definition:
analyticgjrgarchengine.hpp:62
QuantLib::AnalyticGJRGARCHEngine::m2_
Real m2_
Definition:
analyticgjrgarchengine.hpp:73
QuantLib::GenericModelEngine
Base class for some pricing engine on a particular model.
Definition:
genericmodelengine.hpp:40
QuantLib::Real
QL_REAL Real
real number
Definition:
types.hpp:50
QuantLib::Size
std::size_t Size
size of a container
Definition:
types.hpp:58
QuantLib
Definition:
any.hpp:35
Generated by
Doxygen
1.9.5