QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
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
33namespace QuantLib {
34
36
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
Base class for some pricing engine on a particular model.
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