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
LMMCurveState Class Reference

Curve state for Libor market models More...

#include <ql/models/marketmodels/curvestates/lmmcurvestate.hpp>

+ Inheritance diagram for LMMCurveState:
+ Collaboration diagram for LMMCurveState:

Public Member Functions

 LMMCurveState (const std::vector< Time > &rateTimes)
 
Modifiers
void setOnForwardRates (const std::vector< Rate > &fwdRates, Size firstValidIndex=0)
 
void setOnDiscountRatios (const std::vector< DiscountFactor > &discRatios, Size firstValidIndex=0)
 
- Public Member Functions inherited from CurveState
 CurveState (const std::vector< Time > &rateTimes)
 
virtual ~CurveState ()=default
 
Size numberOfRates () const
 
const std::vector< Time > & rateTimes () const
 
const std::vector< Time > & rateTaus () const
 
Rate swapRate (Size begin, Size end) const
 

Inspectors

Size first_
 
std::vector< DiscountFactordiscRatios_
 
std::vector< RateforwardRates_
 
std::vector< RatecmSwapRates_
 
std::vector< RealcmSwapAnnuities_
 
std::vector< RatecotSwapRates_
 
std::vector< RealcotAnnuities_
 
Size firstCotAnnuityComped_
 
Real discountRatio (Size i, Size j) const override
 
Rate forwardRate (Size i) const override
 
Rate coterminalSwapRate (Size i) const override
 
Rate coterminalSwapAnnuity (Size numeraire, Size i) const override
 
Rate cmSwapRate (Size i, Size spanningForwards) const override
 
Rate cmSwapAnnuity (Size numeraire, Size i, Size spanningForwards) const override
 
const std::vector< Rate > & forwardRates () const override
 
const std::vector< Rate > & coterminalSwapRates () const override
 
const std::vector< Rate > & cmSwapRates (Size spanningForwards) const override
 
std::unique_ptr< CurveStateclone () const override
 

Additional Inherited Members

- Protected Attributes inherited from CurveState
Size numberOfRates_
 
std::vector< TimerateTimes_
 
std::vector< TimerateTaus_
 

Detailed Description

Curve state for Libor market models

This class stores the state of the yield curve associated to the fixed calendar times within the simulation. This is the workhorse discounting object associated to the rate times of the simulation. It's important to pass the rates via an object like this to the product rather than directly to make it easier to switch to other engines such as a coterminal swap rate engine. Many products will not need expired rates and others will only require the first rate.

Definition at line 39 of file lmmcurvestate.hpp.

Constructor & Destructor Documentation

◆ LMMCurveState()

LMMCurveState ( const std::vector< Time > &  rateTimes)
explicit

Definition at line 28 of file lmmcurvestate.cpp.

Member Function Documentation

◆ setOnForwardRates()

void setOnForwardRates ( const std::vector< Rate > &  fwdRates,
Size  firstValidIndex = 0 
)

Definition at line 41 of file lmmcurvestate.cpp.

+ Here is the caller graph for this function:

◆ setOnDiscountRatios()

void setOnDiscountRatios ( const std::vector< DiscountFactor > &  discRatios,
Size  firstValidIndex = 0 
)

Definition at line 70 of file lmmcurvestate.cpp.

+ Here is the caller graph for this function:

◆ discountRatio()

Real discountRatio ( Size  i,
Size  j 
) const
overridevirtual

Implements CurveState.

Definition at line 98 of file lmmcurvestate.cpp.

+ Here is the caller graph for this function:

◆ forwardRate()

Rate forwardRate ( Size  i) const
overridevirtual

Implements CurveState.

Definition at line 105 of file lmmcurvestate.cpp.

◆ coterminalSwapRate()

Rate coterminalSwapRate ( Size  i) const
overridevirtual

Implements CurveState.

Definition at line 138 of file lmmcurvestate.cpp.

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

◆ coterminalSwapAnnuity()

Rate coterminalSwapAnnuity ( Size  numeraire,
Size  i 
) const
overridevirtual

Implements CurveState.

Definition at line 111 of file lmmcurvestate.cpp.

+ Here is the caller graph for this function:

◆ cmSwapRate()

Rate cmSwapRate ( Size  i,
Size  spanningForwards 
) const
overridevirtual

Implements CurveState.

Definition at line 165 of file lmmcurvestate.cpp.

+ Here is the call graph for this function:

◆ cmSwapAnnuity()

Rate cmSwapAnnuity ( Size  numeraire,
Size  i,
Size  spanningForwards 
) const
overridevirtual

Implements CurveState.

Definition at line 150 of file lmmcurvestate.cpp.

+ Here is the call graph for this function:

◆ forwardRates()

const std::vector< Rate > & forwardRates ( ) const
overridevirtual

Implements CurveState.

Definition at line 177 of file lmmcurvestate.cpp.

+ Here is the caller graph for this function:

◆ coterminalSwapRates()

const std::vector< Rate > & coterminalSwapRates ( ) const
overridevirtual

Implements CurveState.

Definition at line 182 of file lmmcurvestate.cpp.

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

◆ cmSwapRates()

const std::vector< Rate > & cmSwapRates ( Size  spanningForwards) const
overridevirtual

Implements CurveState.

Definition at line 190 of file lmmcurvestate.cpp.

+ Here is the call graph for this function:

◆ clone()

std::unique_ptr< CurveState > clone ( ) const
overridevirtual

Implements CurveState.

Definition at line 198 of file lmmcurvestate.cpp.

Member Data Documentation

◆ first_

Size first_
private

Definition at line 78 of file lmmcurvestate.hpp.

◆ discRatios_

std::vector<DiscountFactor> discRatios_
private

Definition at line 79 of file lmmcurvestate.hpp.

◆ forwardRates_

std::vector<Rate> forwardRates_
private

Definition at line 80 of file lmmcurvestate.hpp.

◆ cmSwapRates_

std::vector<Rate> cmSwapRates_
mutableprivate

Definition at line 81 of file lmmcurvestate.hpp.

◆ cmSwapAnnuities_

std::vector<Real> cmSwapAnnuities_
mutableprivate

Definition at line 82 of file lmmcurvestate.hpp.

◆ cotSwapRates_

std::vector<Rate> cotSwapRates_
mutableprivate

Definition at line 83 of file lmmcurvestate.hpp.

◆ cotAnnuities_

std::vector<Real> cotAnnuities_
mutableprivate

Definition at line 84 of file lmmcurvestate.hpp.

◆ firstCotAnnuityComped_

Size firstCotAnnuityComped_
mutableprivate

Definition at line 86 of file lmmcurvestate.hpp.