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
InflationIndex Class Referenceabstract

Base class for inflation-rate indexes,. More...

#include <ql/indexes/inflationindex.hpp>

+ Inheritance diagram for InflationIndex:
+ Collaboration diagram for InflationIndex:

Public Member Functions

 InflationIndex (std::string familyName, Region region, bool revised, Frequency frequency, const Period &availabilitiyLag, Currency currency)
 
QL_DEPRECATED InflationIndex (std::string familyName, Region region, bool revised, bool interpolated, Frequency frequency, const Period &availabilitiyLag, Currency currency)
 
Index interface
std::string name () const override
 Returns the name of the index. More...
 
Calendar fixingCalendar () const override
 
bool isValidFixingDate (const Date &) const override
 returns TRUE if the fixing date is a valid one More...
 
Real fixing (const Date &fixingDate, bool forecastTodaysFixing=false) const override=0
 
void addFixing (const Date &fixingDate, Rate fixing, bool forceOverwrite=false) override
 
Observer interface
void update () override
 
- Public Member Functions inherited from Index
 ~Index () override=default
 
virtual std::string name () const =0
 Returns the name of the index. More...
 
virtual Calendar fixingCalendar () const =0
 returns the calendar defining valid fixing dates More...
 
virtual bool isValidFixingDate (const Date &fixingDate) const =0
 returns TRUE if the fixing date is a valid one More...
 
bool hasHistoricalFixing (const Date &fixingDate) const
 returns whether a historical fixing was stored for the given date More...
 
virtual Real fixing (const Date &fixingDate, bool forecastTodaysFixing=false) const =0
 returns the fixing at the given date More...
 
const TimeSeries< Real > & timeSeries () const
 returns the fixing TimeSeries More...
 
virtual bool allowsNativeFixings ()
 check if index allows for native fixings. More...
 
virtual void addFixing (const Date &fixingDate, Real fixing, bool forceOverwrite=false)
 stores the historical fixing at the given date More...
 
void addFixings (const TimeSeries< Real > &t, bool forceOverwrite=false)
 stores historical fixings from a TimeSeries More...
 
template<class DateIterator , class ValueIterator >
void addFixings (DateIterator dBegin, DateIterator dEnd, ValueIterator vBegin, bool forceOverwrite=false)
 stores historical fixings at the given dates More...
 
void clearFixings ()
 clears all stored historical fixings More...
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 
- 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 ()
 

Inspectors

Date referenceDate_
 
std::string familyName_
 
Region region_
 
bool revised_
 
Frequency frequency_
 
Period availabilityLag_
 
Currency currency_
 
QL_DEPRECATED bool interpolated_ = false
 
std::string name_
 
std::string familyName () const
 
Region region () const
 
bool revised () const
 
QL_DEPRECATED bool interpolated () const
 
Frequency frequency () const
 
Period availabilityLag () const
 
Currency currency () const
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 

Detailed Description

Base class for inflation-rate indexes,.

Definition at line 65 of file inflationindex.hpp.

Constructor & Destructor Documentation

◆ InflationIndex() [1/2]

QL_DEPRECATED_DISABLE_WARNING InflationIndex ( std::string  familyName,
Region  region,
bool  revised,
Frequency  frequency,
const Period availabilitiyLag,
Currency  currency 
)

Definition at line 88 of file inflationindex.cpp.

+ Here is the call graph for this function:

◆ InflationIndex() [2/2]

InflationIndex ( std::string  familyName,
Region  region,
bool  revised,
bool  interpolated,
Frequency  frequency,
const Period availabilitiyLag,
Currency  currency 
)
Deprecated:
Use the constructor without the "interpolated" parameter. Deprecated in version 1.29.

Definition at line 66 of file inflationindex.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ name()

std::string name ( ) const
overridevirtual

Returns the name of the index.

Warning:
This method is used for output and comparison between indexes. It is not meant to be used for writing switch-on-type code.

Implements Index.

Definition at line 332 of file inflationindex.hpp.

+ Here is the caller graph for this function:

◆ fixingCalendar()

Calendar fixingCalendar ( ) const
overridevirtual

Inflation indices do not have fixing calendars. An inflation index value is valid for every day (including weekends) of a calendar period. I.e. it uses the NullCalendar as its fixing calendar.

Implements Index.

Definition at line 108 of file inflationindex.cpp.

◆ isValidFixingDate()

bool isValidFixingDate ( const Date fixingDate) const
overridevirtual

returns TRUE if the fixing date is a valid one

Implements Index.

Definition at line 96 of file inflationindex.hpp.

◆ fixing()

Real fixing ( const Date fixingDate,
bool  forecastTodaysFixing = false 
) const
overridepure virtual

Forecasting index values requires an inflation term structure. The inflation term structure (ITS) defines the usual lag (not the index). I.e. an ITS is always relatve to a base date that is earlier than its asof date. This must be so because indices are available only with a lag. However, the index availability lag only sets a minimum lag for the ITS. An ITS may be relative to an earlier date, e.g. an index may have a 2-month delay in publication but the inflation swaps may take as their base the index 3 months before.

Implements Index.

Implemented in ZeroInflationIndex, and YoYInflationIndex.

+ Here is the caller graph for this function:

◆ addFixing()

void addFixing ( const Date fixingDate,
Rate  fixing,
bool  forceOverwrite = false 
)
overridevirtual

this method creates all the "fixings" for the relevant period of the index. E.g. for monthly indices it will put the same value in every calendar day in the month.

Reimplemented from Index.

Definition at line 113 of file inflationindex.cpp.

+ Here is the call graph for this function:

◆ 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 336 of file inflationindex.hpp.

+ Here is the call graph for this function:

◆ familyName()

std::string familyName ( ) const

Definition at line 340 of file inflationindex.hpp.

+ Here is the caller graph for this function:

◆ region()

Region region ( ) const

Definition at line 344 of file inflationindex.hpp.

+ Here is the caller graph for this function:

◆ revised()

bool revised ( ) const

Definition at line 348 of file inflationindex.hpp.

+ Here is the caller graph for this function:

◆ interpolated()

QL_DEPRECATED_ENABLE_WARNING bool interpolated ( ) const

Forecasting index values using an inflation term structure uses the interpolation of the inflation term structure unless interpolation is set to false. In this case the extrapolated values are constant within each period taking the mid-period extrapolated value.

Deprecated:
Don't use this method. Indexes should only be asked monthly fixings (by convention, on the first of the month); interpolation is delegated to coupons. Deprecated in version 1.29.

Definition at line 102 of file inflationindex.cpp.

+ Here is the caller graph for this function:

◆ frequency()

Frequency frequency ( ) const

Definition at line 352 of file inflationindex.hpp.

+ Here is the caller graph for this function:

◆ availabilityLag()

Period availabilityLag ( ) const

The availability lag describes when the index is available, not how it is used. Specifically the fixing for, say, January, may only be available in April but the index will always return the index value applicable for January as its January fixing (independent of the lag in availability).

Definition at line 356 of file inflationindex.hpp.

+ Here is the caller graph for this function:

◆ currency()

Currency currency ( ) const

Definition at line 360 of file inflationindex.hpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ referenceDate_

Date referenceDate_
protected

Definition at line 157 of file inflationindex.hpp.

◆ familyName_

std::string familyName_
protected

Definition at line 158 of file inflationindex.hpp.

◆ region_

Region region_
protected

Definition at line 159 of file inflationindex.hpp.

◆ revised_

bool revised_
protected

Definition at line 160 of file inflationindex.hpp.

◆ frequency_

Frequency frequency_
protected

Definition at line 161 of file inflationindex.hpp.

◆ availabilityLag_

Period availabilityLag_
protected

Definition at line 162 of file inflationindex.hpp.

◆ currency_

Currency currency_
protected

Definition at line 163 of file inflationindex.hpp.

◆ interpolated_

QL_DEPRECATED bool interpolated_ = false
protected
Deprecated:
Don't use this data member. Indexes should only be asked monthly fixings (by convention, on the first of the month); interpolation is delegated to coupons. Deprecated in version 1.29.

Definition at line 172 of file inflationindex.hpp.

◆ name_

std::string name_
private

Definition at line 175 of file inflationindex.hpp.