QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Base class for inflation-rate indexes,. More...
#include <inflationindex.hpp>
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. 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 &) | |
Observable & | operator= (const Observable &) |
Observable (Observable &&)=delete | |
Observable & | operator= (Observable &&)=delete |
virtual | ~Observable ()=default |
void | notifyObservers () |
Public Member Functions inherited from Observer | |
Observer ()=default | |
Observer (const Observer &) | |
Observer & | operator= (const Observer &) |
virtual | ~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 | update ()=0 |
virtual void | deepUpdate () |
Inspectors | |
Date | referenceDate_ |
std::string | familyName_ |
Region | region_ |
bool | revised_ |
Frequency | frequency_ |
Period | availabilityLag_ |
Currency | currency_ |
std::string | name_ |
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 |
Base class for inflation-rate indexes,.
Definition at line 65 of file inflationindex.hpp.
|
overridevirtual |
Returns the name of the index.
Implements Index.
Definition at line 286 of file inflationindex.hpp.
|
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 79 of file inflationindex.cpp.
returns TRUE if the fixing date is a valid one
Implements Index.
Definition at line 84 of file inflationindex.hpp.
|
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.
|
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 84 of file inflationindex.cpp.
|
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 290 of file inflationindex.hpp.
std::string familyName | ( | ) | const |
Region region | ( | ) | const |
bool revised | ( | ) | const |
Frequency frequency | ( | ) | 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.
Definition at line 306 of file inflationindex.hpp.
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 310 of file inflationindex.hpp.
Currency currency | ( | ) | const |
|
protected |
Definition at line 136 of file inflationindex.hpp.
|
protected |
Definition at line 137 of file inflationindex.hpp.
|
protected |
Definition at line 138 of file inflationindex.hpp.
|
protected |
Definition at line 139 of file inflationindex.hpp.
|
protected |
Definition at line 140 of file inflationindex.hpp.
|
protected |
Definition at line 141 of file inflationindex.hpp.
|
protected |
Definition at line 142 of file inflationindex.hpp.
|
private |
Definition at line 145 of file inflationindex.hpp.