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

Base class for year-on-year inflation indices. More...

#include <ql/indexes/inflationindex.hpp>

Inheritance diagram for YoYInflationIndex:

Public Member Functions

Constructors
 YoYInflationIndex (const ext::shared_ptr< ZeroInflationIndex > &underlyingIndex, Handle< YoYInflationTermStructure > ts={})
 Constructor for year-on-year indices defined as a ratio.
 YoYInflationIndex (const ext::shared_ptr< ZeroInflationIndex > &underlyingIndex, bool interpolated, Handle< YoYInflationTermStructure > ts={})
 YoYInflationIndex (const std::string &familyName, const Region &region, bool revised, Frequency frequency, const Period &availabilityLag, const Currency &currency, Handle< YoYInflationTermStructure > ts={})
 Constructor for quoted year-on-year indices.
 YoYInflationIndex (const std::string &familyName, const Region &region, bool revised, bool interpolated, Frequency frequency, const Period &availabilityLag, const Currency &currency, Handle< YoYInflationTermStructure > ts={})
Index interface
Rate fixing (const Date &fixingDate, bool forecastTodaysFixing=false) const override
Real pastFixing (const Date &fixingDate) const override
 returns a past fixing at the given date
Public Member Functions inherited from InflationIndex
 InflationIndex (std::string familyName, Region region, bool revised, Frequency frequency, const Period &availabilitiyLag, Currency currency)
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
void addFixing (const Date &fixingDate, Rate fixing, bool forceOverwrite=false) override
std::string familyName () const
Region region () const
bool revised () const
Frequency frequency () const
Period availabilityLag () const
Currency currency () const
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 ()

Other methods

bool interpolated_
Date lastFixingDate () const
bool interpolated () const
bool ratio () const
ext::shared_ptr< ZeroInflationIndexunderlyingIndex () const
Handle< YoYInflationTermStructureyoyInflationTermStructure () const
ext::shared_ptr< YoYInflationIndexclone (const Handle< YoYInflationTermStructure > &h) const
bool needsForecast (const Date &fixingDate) const

Additional Inherited Members

Public Types inherited from Observer
typedef set_type::iterator iterator
ext::shared_ptr< Observablenotifier () const
Date referenceDate_
std::string familyName_
Region region_
bool revised_
Frequency frequency_
Period availabilityLag_
Currency currency_

Detailed Description

Base class for year-on-year inflation indices.

These may be quoted indices published on, say, Bloomberg, or can be defined as the ratio of an index at different time points.

Constructor & Destructor Documentation

◆ YoYInflationIndex() [1/4]

YoYInflationIndex ( const ext::shared_ptr< ZeroInflationIndex > & underlyingIndex,
Handle< YoYInflationTermStructure > ts = {} )
explicit

Constructor for year-on-year indices defined as a ratio.

An index build with this constructor won't store past fixings of its own; they will be calculated as a ratio from the past fixings stored in the underlying index.

◆ YoYInflationIndex() [2/4]

YoYInflationIndex ( const ext::shared_ptr< ZeroInflationIndex > & underlyingIndex,
bool interpolated,
Handle< YoYInflationTermStructure > ts = {} )
Deprecated
Use the similar overload without the interpolated parameter. Deprecated in version 1.38.

◆ YoYInflationIndex() [3/4]

YoYInflationIndex ( const std::string & familyName,
const Region & region,
bool revised,
Frequency frequency,
const Period & availabilityLag,
const Currency & currency,
Handle< YoYInflationTermStructure > ts = {} )

Constructor for quoted year-on-year indices.

An index built with this constructor needs its past fixings (i.e., the past year-on-year values) to be stored via the addFixing or addFixings method.

◆ YoYInflationIndex() [4/4]

YoYInflationIndex ( const std::string & familyName,
const Region & region,
bool revised,
bool interpolated,
Frequency frequency,
const Period & availabilityLag,
const Currency & currency,
Handle< YoYInflationTermStructure > ts = {} )
Deprecated
Use the similar overload without the interpolated parameter. Deprecated in version 1.38.

Member Function Documentation

◆ fixing()

Rate fixing ( const Date & fixingDate,
bool forecastTodaysFixing = false ) const
overridevirtual
Warning
the forecastTodaysFixing parameter (required by the Index interface) is currently ignored.

Implements InflationIndex.

◆ pastFixing()

Real pastFixing ( const Date & fixingDate) const
overridevirtual

returns a past fixing at the given date

Implements InflationIndex.