QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
HybridHestonHullWhiteProcess Class Reference

Hybrid Heston Hull-White stochastic process. More...

#include <hybridhestonhullwhiteprocess.hpp>

+ Inheritance diagram for HybridHestonHullWhiteProcess:
+ Collaboration diagram for HybridHestonHullWhiteProcess:

Public Types

enum  Discretization { Euler , BSMHullWhite }
 
- Public Types inherited from Observer
typedef set_type::iterator iterator
 

Public Member Functions

 HybridHestonHullWhiteProcess (const ext::shared_ptr< HestonProcess > &hestonProcess, const ext::shared_ptr< HullWhiteForwardProcess > &hullWhiteProcess, Real corrEquityShortRate, Discretization discretization=BSMHullWhite)
 
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
 
DiscountFactor numeraire (Time t, const Array &x) const
 
const ext::shared_ptr< HestonProcess > & hestonProcess () const
 
const ext::shared_ptr< HullWhiteForwardProcess > & hullWhiteProcess () const
 
Real eta () const
 
Time time (const Date &date) const override
 
Discretization discretization () const
 
void update () 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 ()
 

Protected Attributes

const ext::shared_ptr< HestonProcesshestonProcess_
 
const ext::shared_ptr< HullWhiteForwardProcesshullWhiteProcess_
 
const ext::shared_ptr< HullWhitehullWhiteModel_
 
const Real corrEquityShortRate_
 
const Discretization discretization_
 
const Real maxRho_
 
const Time T_
 
DiscountFactor endDiscount_
 
- Protected Attributes inherited from StochasticProcess
ext::shared_ptr< discretizationdiscretization_
 

Additional Inherited Members

- Protected Member Functions inherited from StochasticProcess
 StochasticProcess ()=default
 
 StochasticProcess (ext::shared_ptr< discretization >)
 

Detailed Description

Hybrid Heston Hull-White stochastic process.

This class implements a three factor Heston Hull-White model

Bug:
This class was not tested enough to guarantee its functionality... work in progress

Definition at line 42 of file hybridhestonhullwhiteprocess.hpp.

Member Enumeration Documentation

◆ Discretization

Enumerator
Euler 
BSMHullWhite 

Definition at line 44 of file hybridhestonhullwhiteprocess.hpp.

Constructor & Destructor Documentation

◆ HybridHestonHullWhiteProcess()

HybridHestonHullWhiteProcess ( const ext::shared_ptr< HestonProcess > &  hestonProcess,
const ext::shared_ptr< HullWhiteForwardProcess > &  hullWhiteProcess,
Real  corrEquityShortRate,
HybridHestonHullWhiteProcess::Discretization  discretization = BSMHullWhite 
)

Definition at line 30 of file hybridhestonhullwhiteprocess.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 56 of file hybridhestonhullwhiteprocess.cpp.

◆ initialValues()

Array initialValues ( ) const
overridevirtual

returns the initial values of the state variables

Implements StochasticProcess.

Definition at line 60 of file hybridhestonhullwhiteprocess.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 68 of file hybridhestonhullwhiteprocess.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 90 of file hybridhestonhullwhiteprocess.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 79 of file hybridhestonhullwhiteprocess.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 107 of file hybridhestonhullwhiteprocess.cpp.

+ Here is the call graph for this function:

◆ numeraire()

DiscountFactor numeraire ( Time  t,
const Array x 
) const

Definition at line 200 of file hybridhestonhullwhiteprocess.cpp.

◆ hestonProcess()

const ext::shared_ptr< HestonProcess > & hestonProcess ( ) const

Definition at line 210 of file hybridhestonhullwhiteprocess.cpp.

+ Here is the caller graph for this function:

◆ hullWhiteProcess()

const ext::shared_ptr< HullWhiteForwardProcess > & hullWhiteProcess ( ) const

Definition at line 215 of file hybridhestonhullwhiteprocess.cpp.

+ Here is the caller graph for this function:

◆ eta()

Real eta ( ) const

Definition at line 205 of file hybridhestonhullwhiteprocess.cpp.

+ Here is the caller graph for this function:

◆ 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 224 of file hybridhestonhullwhiteprocess.cpp.

◆ discretization()

Definition at line 220 of file hybridhestonhullwhiteprocess.cpp.

◆ update()

void update ( )
overridevirtual

This method must be implemented in derived classes. An instance of Observer does not call this method directly: instead, it will be called by the observables the instance registered with when they need to notify any changes.

Implements Observer.

Definition at line 228 of file hybridhestonhullwhiteprocess.cpp.

Member Data Documentation

◆ hestonProcess_

const ext::shared_ptr<HestonProcess> hestonProcess_
protected

Definition at line 71 of file hybridhestonhullwhiteprocess.hpp.

◆ hullWhiteProcess_

const ext::shared_ptr<HullWhiteForwardProcess> hullWhiteProcess_
protected

Definition at line 72 of file hybridhestonhullwhiteprocess.hpp.

◆ hullWhiteModel_

const ext::shared_ptr<HullWhite> hullWhiteModel_
protected

Definition at line 75 of file hybridhestonhullwhiteprocess.hpp.

◆ corrEquityShortRate_

const Real corrEquityShortRate_
protected

Definition at line 77 of file hybridhestonhullwhiteprocess.hpp.

◆ discretization_

const Discretization discretization_
protected

Definition at line 78 of file hybridhestonhullwhiteprocess.hpp.

◆ maxRho_

const Real maxRho_
protected

Definition at line 79 of file hybridhestonhullwhiteprocess.hpp.

◆ T_

const Time T_
protected

Definition at line 80 of file hybridhestonhullwhiteprocess.hpp.

◆ endDiscount_

DiscountFactor endDiscount_
protected

Definition at line 81 of file hybridhestonhullwhiteprocess.hpp.