QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
GJRGARCHProcess Class Reference

Stochastic-volatility GJR-GARCH(1,1) process. More...

#include <ql/processes/gjrgarchprocess.hpp>

+ Inheritance diagram for GJRGARCHProcess:
+ Collaboration diagram for GJRGARCHProcess:

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 &)
 
Observeroperator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, boolregisterWith (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 &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 

Private Attributes

Handle< YieldTermStructureriskFreeRate_
 
Handle< YieldTermStructuredividendYield_
 
Handle< Quotes0_
 
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< discretizationdiscretization_
 

Detailed Description

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.

Member Enumeration Documentation

◆ Discretization

Enumerator
PartialTruncation 
FullTruncation 
Reflection 

Definition at line 66 of file gjrgarchprocess.hpp.

Constructor & Destructor Documentation

◆ GJRGARCHProcess()

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 
)

Definition at line 29 of file gjrgarchprocess.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ size()

Size size ( ) const
overridevirtual

returns the number of dimensions of the stochastic process

Implements StochasticProcess.

Definition at line 49 of file gjrgarchprocess.cpp.

◆ initialValues()

Array initialValues ( ) const
overridevirtual

returns the initial values of the state variables

Implements StochasticProcess.

Definition at line 53 of file gjrgarchprocess.cpp.

◆ drift()

Array drift ( Time  t,
const Array x 
) const
overridevirtual

returns the drift part of the equation, i.e., \( \mu(t, \mathrm{x}_t) \)

Implements StochasticProcess.

Definition at line 57 of file gjrgarchprocess.cpp.

◆ diffusion()

Matrix diffusion ( Time  t,
const Array x 
) const
overridevirtual

returns the diffusion part of the equation, i.e. \( \sigma(t, \mathrm{x}_t) \)

Implements StochasticProcess.

Definition at line 76 of file gjrgarchprocess.cpp.

◆ apply()

Array apply ( const Array x0,
const Array dx 
) const
overridevirtual

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.

◆ evolve()

Array evolve ( Time  t0,
const Array x0,
Time  dt,
const Array dw 
) const
overridevirtual

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.

◆ v0()

Real v0 ( ) const

Definition at line 88 of file gjrgarchprocess.hpp.

◆ lambda()

Real lambda ( ) const

Definition at line 89 of file gjrgarchprocess.hpp.

◆ omega()

Real omega ( ) const

Definition at line 90 of file gjrgarchprocess.hpp.

◆ alpha()

Real alpha ( ) const

Definition at line 91 of file gjrgarchprocess.hpp.

◆ beta()

Real beta ( ) const

Definition at line 92 of file gjrgarchprocess.hpp.

◆ gamma()

Real gamma ( ) const

Definition at line 93 of file gjrgarchprocess.hpp.

◆ daysPerYear()

Real daysPerYear ( ) const

Definition at line 94 of file gjrgarchprocess.hpp.

◆ s0()

const Handle< Quote > & s0 ( ) const

Definition at line 190 of file gjrgarchprocess.cpp.

◆ dividendYield()

const Handle< YieldTermStructure > & dividendYield ( ) const

Definition at line 194 of file gjrgarchprocess.cpp.

◆ riskFreeRate()

const Handle< YieldTermStructure > & riskFreeRate ( ) const

Definition at line 198 of file gjrgarchprocess.cpp.

◆ time()

Time time ( const Date ) const
overridevirtual

returns the time value corresponding to the given date in the reference system of the stochastic process.

Note
As a number of processes might not need this functionality, a default implementation is given which raises an exception.

Reimplemented from StochasticProcess.

Definition at line 202 of file gjrgarchprocess.cpp.

Member Data Documentation

◆ riskFreeRate_

Handle<YieldTermStructure> riskFreeRate_
private

Definition at line 103 of file gjrgarchprocess.hpp.

◆ dividendYield_

Handle<YieldTermStructure> dividendYield_
private

Definition at line 103 of file gjrgarchprocess.hpp.

◆ s0_

Handle<Quote> s0_
private

Definition at line 104 of file gjrgarchprocess.hpp.

◆ v0_

Real v0_
private

Definition at line 105 of file gjrgarchprocess.hpp.

◆ omega_

Real omega_
private

Definition at line 105 of file gjrgarchprocess.hpp.

◆ alpha_

Real alpha_
private

Definition at line 105 of file gjrgarchprocess.hpp.

◆ beta_

Real beta_
private

Definition at line 105 of file gjrgarchprocess.hpp.

◆ gamma_

Real gamma_
private

Definition at line 105 of file gjrgarchprocess.hpp.

◆ lambda_

Real lambda_
private

Definition at line 105 of file gjrgarchprocess.hpp.

◆ daysPerYear_

Real daysPerYear_
private

Definition at line 105 of file gjrgarchprocess.hpp.

◆ discretization_

Discretization discretization_
private

Definition at line 106 of file gjrgarchprocess.hpp.