QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
|
Stochastic-volatility GJR-GARCH(1,1) process. More...
#include <ql/processes/gjrgarchprocess.hpp>
Public Types | |
enum | Discretization { PartialTruncation , FullTruncation , Reflection } |
Public Types inherited from Observer | |
typedef set_type::iterator | iterator |
Public Member Functions | |
GJRGARCHProcess (Handle< YieldTermStructure > riskFreeRate, Handle< YieldTermStructure > dividendYield, Handle< Quote > s0, Real v0, Real omega, Real alpha, Real beta, Real gamma, Real lambda, Real daysPerYear=252.0, Discretization d=FullTruncation) | |
Size | size () const override |
returns the number of dimensions of the stochastic process More... | |
Array | initialValues () const override |
returns the initial values of the state variables More... | |
Array | drift (Time t, const Array &x) const override |
returns the drift part of the equation, i.e., \( \mu(t, \mathrm{x}_t) \) More... | |
Matrix | diffusion (Time t, const Array &x) const override |
returns the diffusion part of the equation, i.e. \( \sigma(t, \mathrm{x}_t) \) More... | |
Array | apply (const Array &x0, const Array &dx) const override |
Array | evolve (Time t0, const Array &x0, Time dt, const Array &dw) const override |
Real | v0 () const |
Real | lambda () const |
Real | omega () const |
Real | alpha () const |
Real | beta () const |
Real | gamma () const |
Real | daysPerYear () const |
const Handle< Quote > & | s0 () const |
const Handle< YieldTermStructure > & | dividendYield () const |
const Handle< YieldTermStructure > & | riskFreeRate () const |
Time | time (const Date &) const override |
Public Member Functions inherited from StochasticProcess | |
~StochasticProcess () override=default | |
virtual Size | factors () const |
returns the number of independent factors of the process More... | |
virtual Array | expectation (Time t0, const Array &x0, Time dt) const |
virtual Matrix | stdDeviation (Time t0, const Array &x0, Time dt) const |
virtual Matrix | covariance (Time t0, const Array &x0, Time dt) const |
void | update () override |
Public Member Functions inherited from Observer | |
Observer ()=default | |
Observer (const Observer &) | |
Observer & | operator= (const Observer &) |
virtual | ~Observer () |
std::pair< iterator, bool > | registerWith (const ext::shared_ptr< Observable > &) |
void | registerWithObservables (const ext::shared_ptr< Observer > &) |
Size | unregisterWith (const ext::shared_ptr< Observable > &) |
void | unregisterWithAll () |
virtual void | update ()=0 |
virtual void | deepUpdate () |
Public Member Functions inherited from Observable | |
Observable () | |
Observable (const Observable &) | |
Observable & | operator= (const Observable &) |
Observable (Observable &&)=delete | |
Observable & | operator= (Observable &&)=delete |
virtual | ~Observable ()=default |
void | notifyObservers () |
Private Attributes | |
Handle< YieldTermStructure > | riskFreeRate_ |
Handle< YieldTermStructure > | dividendYield_ |
Handle< Quote > | s0_ |
Real | v0_ |
Real | omega_ |
Real | alpha_ |
Real | beta_ |
Real | gamma_ |
Real | lambda_ |
Real | daysPerYear_ |
Discretization | discretization_ |
Additional Inherited Members | |
Protected Member Functions inherited from StochasticProcess | |
StochasticProcess ()=default | |
StochasticProcess (ext::shared_ptr< discretization >) | |
Protected Attributes inherited from StochasticProcess | |
ext::shared_ptr< discretization > | discretization_ |
Stochastic-volatility GJR-GARCH(1,1) process.
This class describes the stochastic volatility process governed by
\[ \begin{array}{rcl} dS(t, S) &=& \mu S dt + \sqrt{v} S dW_1 \\ dv(t, S) &=& (\omega + (\beta + \alpha * q_{2} + \gamma * q_{3} - 1) v) dt + (\alpha \sigma_{12} + \gamma \sigma_{13}) v dW_1 + \sqrt{\alpha^{2} (\sigma^{2}_{2} - \sigma^{2}_{12}) + \gamma^{2} (\sigma^{2}_{3} - \sigma^{2}_{13}) + 2 \alpha \gamma (\sigma_{23} - \sigma_{12} \sigma_{13})} v dW_2 \ \ N = normalCDF(\lambda) \\ n &=& \exp{-\lambda^{2}/2} / \sqrt{2 \pi} \\ q_{2} &=& 1 + \lambda^{2} \\ q_{3} &=& \lambda n + N + \lambda^2 N \\ \sigma^{2}_{2} = 2 + 4 \lambda^{4} \\ \sigma^{2}_{3} = \lambda^{3} n + 5 \lambda n + 3N + \lambda^{4} N + 6 \lambda^{2} N -\\lambda^{2} n^{2} - N^{2} - \lambda^{4} N^{2} - 2 \lambda n N - 2 \lambda^{3} nN - 2 \lambda^{2} N^{2} \ \ \sigma_{12} = -2 \lambda \\ \sigma_{13} = -2 n - 2 \lambda N \\ \sigma_{23} = 2N + \sigma_{12} \sigma_{13} \\ \end{array} \]
Definition at line 64 of file gjrgarchprocess.hpp.
enum Discretization |
Enumerator | |
---|---|
PartialTruncation | |
FullTruncation | |
Reflection |
Definition at line 66 of file gjrgarchprocess.hpp.
GJRGARCHProcess | ( | Handle< YieldTermStructure > | riskFreeRate, |
Handle< YieldTermStructure > | dividendYield, | ||
Handle< Quote > | s0, | ||
Real | v0, | ||
Real | omega, | ||
Real | alpha, | ||
Real | beta, | ||
Real | gamma, | ||
Real | lambda, | ||
Real | daysPerYear = 252.0 , |
||
Discretization | d = FullTruncation |
||
) |
|
overridevirtual |
returns the number of dimensions of the stochastic process
Implements StochasticProcess.
Definition at line 49 of file gjrgarchprocess.cpp.
|
overridevirtual |
returns the initial values of the state variables
Implements StochasticProcess.
Definition at line 53 of file gjrgarchprocess.cpp.
returns the drift part of the equation, i.e., \( \mu(t, \mathrm{x}_t) \)
Implements StochasticProcess.
Definition at line 57 of file gjrgarchprocess.cpp.
returns the diffusion part of the equation, i.e. \( \sigma(t, \mathrm{x}_t) \)
Implements StochasticProcess.
Definition at line 76 of file gjrgarchprocess.cpp.
applies a change to the asset value. By default, it returns \( \mathrm{x} + \Delta \mathrm{x} \).
Reimplemented from StochasticProcess.
Definition at line 114 of file gjrgarchprocess.cpp.
returns the asset value after a time interval \( \Delta t \) according to the given discretization. By default, it returns
\[ E(\mathrm{x}_0,t_0,\Delta t) + S(\mathrm{x}_0,t_0,\Delta t) \cdot \Delta \mathrm{w} \]
where \( E \) is the expectation and \( S \) the standard deviation.
Reimplemented from StochasticProcess.
Definition at line 119 of file gjrgarchprocess.cpp.
Real v0 | ( | ) | const |
Definition at line 88 of file gjrgarchprocess.hpp.
Real lambda | ( | ) | const |
Definition at line 89 of file gjrgarchprocess.hpp.
Real omega | ( | ) | const |
Definition at line 90 of file gjrgarchprocess.hpp.
Real alpha | ( | ) | const |
Definition at line 91 of file gjrgarchprocess.hpp.
Real beta | ( | ) | const |
Definition at line 92 of file gjrgarchprocess.hpp.
Real gamma | ( | ) | const |
Definition at line 93 of file gjrgarchprocess.hpp.
Real daysPerYear | ( | ) | const |
Definition at line 94 of file gjrgarchprocess.hpp.
Definition at line 190 of file gjrgarchprocess.cpp.
const Handle< YieldTermStructure > & dividendYield | ( | ) | const |
Definition at line 194 of file gjrgarchprocess.cpp.
const Handle< YieldTermStructure > & riskFreeRate | ( | ) | const |
Definition at line 198 of file gjrgarchprocess.cpp.
returns the time value corresponding to the given date in the reference system of the stochastic process.
Reimplemented from StochasticProcess.
Definition at line 202 of file gjrgarchprocess.cpp.
|
private |
Definition at line 103 of file gjrgarchprocess.hpp.
|
private |
Definition at line 103 of file gjrgarchprocess.hpp.
Definition at line 104 of file gjrgarchprocess.hpp.
|
private |
Definition at line 105 of file gjrgarchprocess.hpp.
|
private |
Definition at line 105 of file gjrgarchprocess.hpp.
|
private |
Definition at line 105 of file gjrgarchprocess.hpp.
|
private |
Definition at line 105 of file gjrgarchprocess.hpp.
|
private |
Definition at line 105 of file gjrgarchprocess.hpp.
|
private |
Definition at line 105 of file gjrgarchprocess.hpp.
|
private |
Definition at line 105 of file gjrgarchprocess.hpp.
|
private |
Definition at line 106 of file gjrgarchprocess.hpp.