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

Forward G2 stochastic process More...

#include <ql/processes/g2process.hpp>

+ Inheritance diagram for G2ForwardProcess:
+ Collaboration diagram for G2ForwardProcess:

Public Member Functions

 G2ForwardProcess (Real a, Real sigma, Real b, Real eta, Real rho)
 
- Public Member Functions inherited from ForwardMeasureProcess
virtual void setForwardMeasureTime (Time)
 
Time getForwardMeasureTime () const
 
- 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 evolve (Time t0, const Array &x0, Time dt, const Array &dw) const
 
virtual Array apply (const Array &x0, const Array &dx) const
 
virtual Time time (const Date &) 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 ()
 

StochasticProcess interface

Real x0_ = 0.0
 
Real y0_ = 0.0
 
Real a_
 
Real sigma_
 
Real b_
 
Real eta_
 
Real rho_
 
ext::shared_ptr< QuantLib::OrnsteinUhlenbeckProcessxProcess_
 
ext::shared_ptr< QuantLib::OrnsteinUhlenbeckProcessyProcess_
 
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 expectation (Time t0, const Array &x0, Time dt) const override
 
Matrix stdDeviation (Time t0, const Array &x0, Time dt) const override
 
Matrix covariance (Time t0, const Array &x0, Time dt) const override
 
Real xForwardDrift (Time t, Time T) const
 
Real yForwardDrift (Time t, Time T) const
 
Real Mx_T (Real s, Real t, Real T) const
 
Real My_T (Real s, Real t, Real T) const
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 
- Protected Member Functions inherited from ForwardMeasureProcess
 ForwardMeasureProcess ()=default
 
 ForwardMeasureProcess (Time T)
 
 ForwardMeasureProcess (const ext::shared_ptr< discretization > &)
 
- Protected Member Functions inherited from StochasticProcess
 StochasticProcess ()=default
 
 StochasticProcess (ext::shared_ptr< discretization >)
 
- Protected Attributes inherited from ForwardMeasureProcess
Time T_
 
- Protected Attributes inherited from StochasticProcess
ext::shared_ptr< discretizationdiscretization_
 

Detailed Description

Forward G2 stochastic process

Definition at line 62 of file g2process.hpp.

Constructor & Destructor Documentation

◆ G2ForwardProcess()

G2ForwardProcess ( Real  a,
Real  sigma,
Real  b,
Real  eta,
Real  rho 
)

Definition at line 127 of file g2process.cpp.

Member Function Documentation

◆ size()

Size size ( ) const
overridevirtual

returns the number of dimensions of the stochastic process

Implements StochasticProcess.

Definition at line 132 of file g2process.cpp.

◆ initialValues()

Array initialValues ( ) const
overridevirtual

returns the initial values of the state variables

Implements StochasticProcess.

Definition at line 136 of file g2process.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 140 of file g2process.cpp.

+ Here is the call graph for this function:

◆ 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 147 of file g2process.cpp.

◆ expectation()

Array expectation ( Time  t0,
const Array x0,
Time  dt 
) const
overridevirtual

returns the expectation \( E(\mathrm{x}_{t_0 + \Delta t} | \mathrm{x}_{t_0} = \mathrm{x}_0) \) of the process after a time interval \( \Delta t \) according to the given discretization. This method can be overridden in derived classes which want to hard-code a particular discretization.

Reimplemented from StochasticProcess.

Definition at line 156 of file g2process.cpp.

+ Here is the call graph for this function:

◆ stdDeviation()

Matrix stdDeviation ( Time  t0,
const Array x0,
Time  dt 
) const
overridevirtual

returns the standard deviation \( S(\mathrm{x}_{t_0 + \Delta t} | \mathrm{x}_{t_0} = \mathrm{x}_0) \) of the process after a time interval \( \Delta t \) according to the given discretization. This method can be overridden in derived classes which want to hard-code a particular discretization.

Reimplemented from StochasticProcess.

Definition at line 164 of file g2process.cpp.

+ Here is the caller graph for this function:

◆ covariance()

Matrix covariance ( Time  t0,
const Array x0,
Time  dt 
) const
overridevirtual

returns the covariance \( V(\mathrm{x}_{t_0 + \Delta t} | \mathrm{x}_{t_0} = \mathrm{x}_0) \) of the process after a time interval \( \Delta t \) according to the given discretization. This method can be overridden in derived classes which want to hard-code a particular discretization.

Reimplemented from StochasticProcess.

Definition at line 180 of file g2process.cpp.

+ Here is the call graph for this function:

◆ xForwardDrift()

Real xForwardDrift ( Time  t,
Time  T 
) const
protected

Definition at line 186 of file g2process.cpp.

+ Here is the caller graph for this function:

◆ yForwardDrift()

Real yForwardDrift ( Time  t,
Time  T 
) const
protected

Definition at line 194 of file g2process.cpp.

+ Here is the caller graph for this function:

◆ Mx_T()

Real Mx_T ( Real  s,
Real  t,
Real  T 
) const
protected

Definition at line 202 of file g2process.cpp.

+ Here is the caller graph for this function:

◆ My_T()

Real My_T ( Real  s,
Real  t,
Real  T 
) const
protected

Definition at line 213 of file g2process.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ x0_

Real x0_ = 0.0
protected

Definition at line 76 of file g2process.hpp.

◆ y0_

Real y0_ = 0.0
protected

Definition at line 76 of file g2process.hpp.

◆ a_

Real a_
protected

Definition at line 76 of file g2process.hpp.

◆ sigma_

Real sigma_
protected

Definition at line 76 of file g2process.hpp.

◆ b_

Real b_
protected

Definition at line 76 of file g2process.hpp.

◆ eta_

Real eta_
protected

Definition at line 76 of file g2process.hpp.

◆ rho_

Real rho_
protected

Definition at line 76 of file g2process.hpp.

◆ xProcess_

ext::shared_ptr<QuantLib::OrnsteinUhlenbeckProcess> xProcess_
protected

Definition at line 77 of file g2process.hpp.

◆ yProcess_

ext::shared_ptr<QuantLib::OrnsteinUhlenbeckProcess> yProcess_
protected

Definition at line 78 of file g2process.hpp.