Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
YoYInflationModelTermStructure Class Referenceabstract

#include <qle/models/yoyinflationmodeltermstructure.hpp>

+ Inheritance diagram for YoYInflationModelTermStructure:
+ Collaboration diagram for YoYInflationModelTermStructure:

Public Member Functions

 YoYInflationModelTermStructure (const QuantLib::ext::shared_ptr< CrossAssetModel > &model, QuantLib::Size index, bool indexIsInterpolated)
 
Observer interface
void update () override
 
TermStructure interface
QuantLib::Date maxDate () const override
 
QuantLib::Time maxTime () const override
 
const QuantLib::Date & referenceDate () const override
 

Protected Member Functions

YoYInflationTermStructure interface
QuantLib::Real yoyRateImpl (QuantLib::Time t) const override
 This cannot be called. The implementation is set to throw an exception. More...
 
virtual void checkState () const
 

InflationTermStructure interface

QuantLib::ext::shared_ptr< CrossAssetModelmodel_
 
QuantLib::Size index_
 
bool indexIsInterpolated_
 
QuantLib::Date referenceDate_
 
QuantLib::Time relativeTime_
 
QuantLib::Array state_
 
QuantLib::Date baseDate () const override
 
virtual void referenceDate (const QuantLib::Date &d)
 Set the reference date. More...
 
void state (const QuantLib::Array &s)
 Set the current state variables. More...
 
void move (const QuantLib::Date &d, const QuantLib::Array &s)
 Set the current state and move the reference date to date d. More...
 
QuantLib::Real yoyRate (const QuantLib::Date &d, const QuantLib::Period &obsLag=-1 *QuantLib::Days, bool forceLinearInterpolation=false, bool extrapolate=false) const
 
virtual std::map< QuantLib::Date, QuantLib::Real > yoyRates (const std::vector< QuantLib::Date > &dates, const QuantLib::Period &obsLag=-1 *QuantLib::Days) const =0
 

Detailed Description

Base class for cross asset model implied year on year inflation term structures.

The termstructure has the reference date of the model's term structure at construction, but you can vary this as well as the state. Note that this term structure does not implement the full YoYInflationTermStructure interface. It is questionable whether it should derive from YoYInflationTermStructure at all.

Definition at line 41 of file yoyinflationmodeltermstructure.hpp.

Constructor & Destructor Documentation

◆ YoYInflationModelTermStructure()

YoYInflationModelTermStructure ( const QuantLib::ext::shared_ptr< CrossAssetModel > &  model,
QuantLib::Size  index,
bool  indexIsInterpolated 
)

Constructor taking the cross asset model, model, and the index of the relevant inflation component within the model, index.

Definition at line 29 of file yoyinflationmodeltermstructure.cpp.

32 inflationTermStructure(model, index)->dayCounter(), inflationTermStructure(model, index)->baseRate(),
33 inflationTermStructure(model, index)->observationLag(), inflationTermStructure(model, index)->frequency(),
34 indexIsInterpolated), // the QL constructor is not up to date, but the last argument here will go soon
35 model_(model), index_(index), indexIsInterpolated_(indexIsInterpolated),
37 registerWith(model_);
38 update();
39}
const QuantLib::Date & referenceDate() const override
QuantLib::ext::shared_ptr< CrossAssetModel > model_
Handle< ZeroInflationTermStructure > inflationTermStructure(const QuantLib::ext::shared_ptr< CrossAssetModel > &model, Size index)
+ Here is the call graph for this function:

Member Function Documentation

◆ update()

void update ( )
override

Definition at line 41 of file yoyinflationmodeltermstructure.cpp.

41 {
42 notifyObservers();
43}
+ Here is the caller graph for this function:

◆ maxDate()

Date maxDate ( ) const
override

Definition at line 45 of file yoyinflationmodeltermstructure.cpp.

45 {
46 // we don't care. Let the underlying classes throw exceptions if applicable
47 return Date::maxDate();
48}

◆ maxTime()

Time maxTime ( ) const
override

Definition at line 50 of file yoyinflationmodeltermstructure.cpp.

50 {
51 // see maxDate
52 return QL_MAX_REAL;
53}

◆ referenceDate() [1/2]

const Date & referenceDate ( ) const
override

Definition at line 55 of file yoyinflationmodeltermstructure.cpp.

55 {
56 return referenceDate_;
57}
+ Here is the caller graph for this function:

◆ baseDate()

Date baseDate ( ) const
override

Definition at line 59 of file yoyinflationmodeltermstructure.cpp.

59 {
61 return referenceDate_ - observationLag_;
62 } else {
63 return inflationPeriod(referenceDate_ - observationLag_, frequency()).first;
64 }
65}
+ Here is the caller graph for this function:

◆ referenceDate() [2/2]

virtual void referenceDate ( const QuantLib::Date &  d)
virtual

Set the reference date.

◆ state()

void state ( const QuantLib::Array &  s)

Set the current state variables.

Definition at line 73 of file yoyinflationmodeltermstructure.cpp.

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

◆ move()

void move ( const QuantLib::Date &  d,
const QuantLib::Array &  s 
)

Set the current state and move the reference date to date d.

Definition at line 79 of file yoyinflationmodeltermstructure.cpp.

79 {
80 state(s);
82}
void state(const QuantLib::Array &s)
Set the current state variables.
+ Here is the call graph for this function:

◆ yoyRate()

Real yoyRate ( const QuantLib::Date &  d,
const QuantLib::Period &  obsLag = -1 * QuantLib::Days,
bool  forceLinearInterpolation = false,
bool  extrapolate = false 
) const

Hides the YoYInflationTermStructure::yoyRate method. The parameters forceLinearInterpolation and extrapolate are ignored.

Definition at line 84 of file yoyinflationmodeltermstructure.cpp.

85 {
86 return yoyRates({ d }, obsLag).at(d);
87}
virtual std::map< QuantLib::Date, QuantLib::Real > yoyRates(const std::vector< QuantLib::Date > &dates, const QuantLib::Period &obsLag=-1 *QuantLib::Days) const =0
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ yoyRates()

virtual std::map< QuantLib::Date, QuantLib::Real > yoyRates ( const std::vector< QuantLib::Date > &  dates,
const QuantLib::Period &  obsLag = -1 *QuantLib::Days 
) const
pure virtual

Return the year-on-year rates for the maturities associated with dates. If an obsLag is explicitly provided and not set to -1 * QuantLib::Days, it is used as the observation lag. Otherwise, the term structure's observation lag is used.

Implemented in DkImpliedYoYInflationTermStructure, and JyImpliedYoYInflationTermStructure.

+ Here is the caller graph for this function:

◆ yoyRateImpl()

Real yoyRateImpl ( QuantLib::Time  t) const
overrideprotected

This cannot be called. The implementation is set to throw an exception.

Definition at line 89 of file yoyinflationmodeltermstructure.cpp.

89 {
90 QL_FAIL("YoYInflationModelTermStructure::yoyRateImpl cannot be called.");
91}

◆ checkState()

virtual void checkState ( ) const
protectedvirtual

Override this method to perform checks on the state variable array when the state and move methods are called.

Reimplemented in DkImpliedYoYInflationTermStructure, and JyImpliedYoYInflationTermStructure.

Definition at line 105 of file yoyinflationmodeltermstructure.hpp.

105{}
+ Here is the caller graph for this function:

Member Data Documentation

◆ model_

QuantLib::ext::shared_ptr<CrossAssetModel> model_
protected

Definition at line 88 of file yoyinflationmodeltermstructure.hpp.

◆ index_

QuantLib::Size index_
protected

Definition at line 89 of file yoyinflationmodeltermstructure.hpp.

◆ indexIsInterpolated_

bool indexIsInterpolated_
protected

Definition at line 90 of file yoyinflationmodeltermstructure.hpp.

◆ referenceDate_

QuantLib::Date referenceDate_
protected

Definition at line 92 of file yoyinflationmodeltermstructure.hpp.

◆ relativeTime_

QuantLib::Time relativeTime_
protected

Definition at line 93 of file yoyinflationmodeltermstructure.hpp.

◆ state_

QuantLib::Array state_
protected

Definition at line 94 of file yoyinflationmodeltermstructure.hpp.