QuantLib: a free/open-source library for quantitative finance
Reference manual - version 1.40
Loading...
Searching...
No Matches
InflationIndex Class Referenceabstract

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

#include <ql/indexes/inflationindex.hpp>

Inheritance diagram for InflationIndex:

Public Member Functions

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

Additional Inherited Members

Public Types inherited from Observer
typedef set_type::iterator iterator
ext::shared_ptr< Observablenotifier () const

Detailed Description

Base class for inflation-rate indexes,.

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.

◆ fixingCalendar()

Calendar fixingCalendar ( ) const
overridevirtual

Inflation indices are not associated to a particular day, but to months or quarters. Therefore, they do not have fixing calendars. Since we're forced by the base Index interface to add one, this method returns a NullCalendar instance.

Implements Index.

◆ isValidFixingDate()

bool isValidFixingDate ( const Date & fixingDate) const
overridevirtual

returns TRUE if the fixing date is a valid one

Implements Index.

◆ fixing()

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

Forecasting index values requires an inflation term structure, with a base date that is earlier than its asof date. This must be so because indices are available only with a lag. Usually, it makes sense for the base date to be the first day of the month of the last published fixing.

Implements Index.

Implemented in YoYInflationIndex, and ZeroInflationIndex.

◆ pastFixing()

Real pastFixing ( const Date & fixingDate) const
overridepure virtual

returns a past fixing at the given date

Reimplemented from Index.

Implemented in YoYInflationIndex, and ZeroInflationIndex.

◆ addFixing()

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

Reimplemented from Index.

◆ availabilityLag()

Period availabilityLag ( ) const

The availability lag describes when the index might be available; for instance, the inflation value for January may only be available in April. This doesn't mean that that inflation value is considered as the April fixing; it remains the January fixing, independently of the lag in availability.