QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
gjrgarchprocess.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_gjrgarch_process_hpp
25#define quantlib_gjrgarch_process_hpp
26
27#include <ql/stochasticprocess.hpp>
28#include <ql/termstructures/yieldtermstructure.hpp>
29#include <ql/quote.hpp>
30
31namespace QuantLib {
32
34 // parameters supplied should be daily constants
35 // they are annualized by setting the parameter daysPerYear
65 public:
68
72 Real v0,
73 Real omega,
74 Real alpha,
75 Real beta,
76 Real gamma,
78 Real daysPerYear = 252.0,
80
81 Size size() const override;
82 Array initialValues() const override;
83 Array drift(Time t, const Array& x) const override;
84 Matrix diffusion(Time t, const Array& x) const override;
85 Array apply(const Array& x0, const Array& dx) const override;
86 Array evolve(Time t0, const Array& x0, Time dt, const Array& dw) const override;
87
88 Real v0() const { return v0_; }
89 Real lambda() const { return lambda_; }
90 Real omega() const { return omega_; }
91 Real alpha() const { return alpha_; }
92 Real beta() const { return beta_; }
93 Real gamma() const { return gamma_; }
94 Real daysPerYear() const { return daysPerYear_; }
95
96 const Handle<Quote>& s0() const;
99
100 Time time(const Date&) const override;
101
102 private:
107 };
108
109}
110
111
112#endif
1-D array used in linear algebra.
Definition: array.hpp:52
Concrete date class.
Definition: date.hpp:125
Stochastic-volatility GJR-GARCH(1,1) process.
Array drift(Time t, const Array &x) const override
returns the drift part of the equation, i.e.,
Size size() const override
returns the number of dimensions of the stochastic process
Array evolve(Time t0, const Array &x0, Time dt, const Array &dw) const override
Matrix diffusion(Time t, const Array &x) const override
returns the diffusion part of the equation, i.e.
const Handle< YieldTermStructure > & dividendYield() const
Time time(const Date &) const override
Array initialValues() const override
returns the initial values of the state variables
Handle< YieldTermStructure > dividendYield_
Array apply(const Array &x0, const Array &dx) const override
const Handle< Quote > & s0() const
const Handle< YieldTermStructure > & riskFreeRate() const
Handle< YieldTermStructure > riskFreeRate_
Shared handle to an observable.
Definition: handle.hpp:41
Matrix used in linear algebra.
Definition: matrix.hpp:41
multi-dimensional stochastic process class.
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