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

libor-forward-model process More...

#include <ql/legacy/libormarketmodels/lfmprocess.hpp>

+ Inheritance diagram for LiborForwardModelProcess:
+ Collaboration diagram for LiborForwardModelProcess:

Public Member Functions

 LiborForwardModelProcess (Size size, ext::shared_ptr< IborIndex > index)
 
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...
 
Matrix covariance (Time t0, const Array &x0, Time dt) const override
 
Array apply (const Array &x0, const Array &dx) const override
 
Array evolve (Time t0, const Array &x0, Time dt, const Array &dw) const override
 
Size size () const override
 returns the number of dimensions of the stochastic process More...
 
Size factors () const override
 returns the number of independent factors of the process More...
 
ext::shared_ptr< IborIndexindex () const
 
Leg cashFlows (Real amount=1.0) const
 
void setCovarParam (const ext::shared_ptr< LfmCovarianceParameterization > &param)
 
ext::shared_ptr< LfmCovarianceParameterizationcovarParam () const
 
Size nextIndexReset (Time t) const
 
const std::vector< Time > & fixingTimes () const
 
const std::vector< Date > & fixingDates () const
 
const std::vector< Time > & accrualStartTimes () const
 
const std::vector< Time > & accrualEndTimes () const
 
std::vector< DiscountFactordiscountBond (const std::vector< Rate > &rates) const
 
- Public Member Functions inherited from StochasticProcess
 ~StochasticProcess () override=default
 
virtual Array expectation (Time t0, const Array &x0, Time dt) const
 
virtual Matrix stdDeviation (Time t0, const Array &x0, Time dt) 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 ()
 

Private Attributes

Size size_
 
const ext::shared_ptr< IborIndexindex_
 
ext::shared_ptr< LfmCovarianceParameterizationlfmParam_
 
Array initialValues_
 
std::vector< TimefixingTimes_
 
std::vector< DatefixingDates_
 
std::vector< TimeaccrualStartTimes_
 
std::vector< TimeaccrualEndTimes_
 
std::vector< TimeaccrualPeriod_
 
Array m1
 
Array m2
 

Additional Inherited Members

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

Detailed Description

libor-forward-model process

stochastic process of a libor forward model using the rolling forward measure incl. predictor-corrector step

References:

Glasserman, Paul, 2004, Monte Carlo Methods in Financial Engineering, Springer, Section 3.7

Antoon Pelsser, 2000, Efficient Methods for Valuing Interest Rate Derivatives, Springer, 8

Hull, John, White, Alan, 1999, Forward Rate Volatilities, Swap Rate Volatilities and the Implementation of the Libor Market Model (http://www.rotman.utoronto.ca/~amackay/fin/libormktmodel2.pdf)

Tests:
the correctness is tested by Monte-Carlo reproduction of caplet & ratchet NPVs and comparison with Black pricing.
Warning:
this class does not work correctly with Visual C++ 6.

Definition at line 58 of file lfmprocess.hpp.

Constructor & Destructor Documentation

◆ LiborForwardModelProcess()

LiborForwardModelProcess ( Size  size,
ext::shared_ptr< IborIndex index 
)

Definition at line 33 of file lfmprocess.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ initialValues()

Array initialValues ( ) const
overridevirtual

returns the initial values of the state variables

Implements StochasticProcess.

Definition at line 147 of file lfmprocess.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 lfmprocess.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 85 of file lfmprocess.cpp.

◆ 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 89 of file lfmprocess.cpp.

+ Here is the caller graph for this function:

◆ 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 93 of file lfmprocess.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 103 of file lfmprocess.cpp.

+ Here is the call graph for this function:

◆ size()

Size size ( ) const
overridevirtual

returns the number of dimensions of the stochastic process

Implements StochasticProcess.

Definition at line 183 of file lfmprocess.cpp.

◆ factors()

Size factors ( ) const
overridevirtual

returns the number of independent factors of the process

Reimplemented from StochasticProcess.

Definition at line 187 of file lfmprocess.cpp.

◆ index()

ext::shared_ptr< IborIndex > index ( ) const

Definition at line 162 of file lfmprocess.cpp.

◆ cashFlows()

Leg cashFlows ( Real  amount = 1.0) const

Definition at line 167 of file lfmprocess.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCovarParam()

void setCovarParam ( const ext::shared_ptr< LfmCovarianceParameterization > &  param)

Definition at line 151 of file lfmprocess.cpp.

◆ covarParam()

ext::shared_ptr< LfmCovarianceParameterization > covarParam ( ) const

Definition at line 157 of file lfmprocess.cpp.

◆ nextIndexReset()

Size nextIndexReset ( Time  t) const

Definition at line 209 of file lfmprocess.cpp.

+ Here is the caller graph for this function:

◆ fixingTimes()

const std::vector< Time > & fixingTimes ( ) const

Definition at line 191 of file lfmprocess.cpp.

◆ fixingDates()

const std::vector< Date > & fixingDates ( ) const

Definition at line 195 of file lfmprocess.cpp.

◆ accrualStartTimes()

const std::vector< Time > & accrualStartTimes ( ) const

Definition at line 200 of file lfmprocess.cpp.

◆ accrualEndTimes()

const std::vector< Time > & accrualEndTimes ( ) const

Definition at line 205 of file lfmprocess.cpp.

◆ discountBond()

std::vector< DiscountFactor > discountBond ( const std::vector< Rate > &  rates) const

Definition at line 214 of file lfmprocess.cpp.

Member Data Documentation

◆ size_

Size size_
private

Definition at line 93 of file lfmprocess.hpp.

◆ index_

const ext::shared_ptr<IborIndex> index_
private

Definition at line 95 of file lfmprocess.hpp.

◆ lfmParam_

ext::shared_ptr<LfmCovarianceParameterization> lfmParam_
private

Definition at line 96 of file lfmprocess.hpp.

◆ initialValues_

Array initialValues_
private

Definition at line 98 of file lfmprocess.hpp.

◆ fixingTimes_

std::vector<Time> fixingTimes_
private

Definition at line 100 of file lfmprocess.hpp.

◆ fixingDates_

std::vector<Date> fixingDates_
private

Definition at line 101 of file lfmprocess.hpp.

◆ accrualStartTimes_

std::vector<Time> accrualStartTimes_
private

Definition at line 102 of file lfmprocess.hpp.

◆ accrualEndTimes_

std::vector<Time> accrualEndTimes_
private

Definition at line 103 of file lfmprocess.hpp.

◆ accrualPeriod_

std::vector<Time> accrualPeriod_
private

Definition at line 104 of file lfmprocess.hpp.

◆ m1

Array m1
mutableprivate

Definition at line 106 of file lfmprocess.hpp.

◆ m2

Array m2
private

Definition at line 106 of file lfmprocess.hpp.