QuantLib
A free/open-source library for quantitative finance
Reference manual - version 1.20
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:

Public Member Functions

 InflationIndex (const std::string &familyName, const Region &region, bool revised, bool interpolated, Frequency frequency, const Period &availabilitiyLag, const Currency &currency)
 
Index interface
std::string name () const
 Returns the name of the index. More...
 
Calendar fixingCalendar () const
 
bool isValidFixingDate (const Date &) const
 returns TRUE if the fixing date is a valid one
 
Rate fixing (const Date &fixingDate, bool forecastTodaysFixing=false) const =0
 
void addFixing (const Date &fixingDate, Rate fixing, bool forceOverwrite=false)
 
Observer interface
void update ()
 
- Public Member Functions inherited from Index
const TimeSeries< Real > & timeSeries () const
 returns the fixing TimeSeries
 
virtual bool allowsNativeFixings ()
 check if index allows for native fixings. 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
 
- Public Member Functions inherited from Observable
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
void notifyObservers ()
 
- Public Member Functions inherited from Observer
 Observer (const Observer &)
 
Observeroperator= (const Observer &)
 
std::pair< iterator, bool > registerWith (const ext::shared_ptr< Observable > &)
 
void registerWithObservables (const ext::shared_ptr< Observer > &)
 
Size unregisterWith (const ext::shared_ptr< Observable > &)
 
void unregisterWithAll ()
 
virtual void deepUpdate ()
 

Inspectors

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

Additional Inherited Members

- Public Types inherited from Observer
typedef boost::unordered_set< ext::shared_ptr< Observable > > set_type
 
typedef set_type::iterator iterator
 

Detailed Description

Base class for inflation-rate indexes,.

Constructor & Destructor Documentation

◆ InflationIndex()

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

An inflation index may return interpolated values. These are linearly interpolated values with act/act convention within a period. Note that stored "fixings" are always flat (constant) within a period and interpolated as needed. This is because interpolation adds an addional availability lag (because you always need the next period to give the previous period's value) and enables storage of the most recent uninterpolated value.

Member Function Documentation

◆ name()

std::string name ( ) const
virtual

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.

◆ fixingCalendar()

Calendar fixingCalendar ( ) const
virtual

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.

◆ fixing()

Rate fixing ( const Date fixingDate,
bool  forecastTodaysFixing = false 
) const
pure 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 YoYInflationIndex, and ZeroInflationIndex.

◆ addFixing()

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

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.

◆ update()

void update ( )
virtual

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.

◆ interpolated()

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.

◆ 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).