QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
|
Base class for year-on-year inflation indices. More...
#include <inflationindex.hpp>
Public Member Functions | |
Constructors | |
YoYInflationIndex (const ext::shared_ptr< ZeroInflationIndex > &underlyingIndex, Handle< YoYInflationTermStructure > ts={}) | |
Constructor for year-on-year indices defined as a ratio. More... | |
YoYInflationIndex (const ext::shared_ptr< ZeroInflationIndex > &underlyingIndex, bool interpolated, Handle< YoYInflationTermStructure > ts={}) | |
YoYInflationIndex (const std::string &familyName, const Region ®ion, bool revised, Frequency frequency, const Period &availabilityLag, const Currency ¤cy, Handle< YoYInflationTermStructure > ts={}) | |
Constructor for quoted year-on-year indices. More... | |
YoYInflationIndex (const std::string &familyName, const Region ®ion, bool revised, bool interpolated, Frequency frequency, const Period &availabilityLag, const Currency ¤cy, 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 More... | |
![]() | |
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. More... | |
Calendar | fixingCalendar () const override |
bool | isValidFixingDate (const Date &) const override |
returns TRUE if the fixing date is a valid one More... | |
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 |
![]() | |
~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... | |
virtual Real | pastFixing (const Date &fixingDate) const |
returns a past 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... | |
void | update () override |
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... | |
![]() | |
Observable ()=default | |
Observable (const Observable &) | |
Observable & | operator= (const Observable &) |
Observable (Observable &&)=delete | |
Observable & | operator= (Observable &&)=delete |
virtual | ~Observable ()=default |
void | notifyObservers () |
![]() | |
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 () |
Other methods | |
bool | interpolated_ |
bool | ratio_ |
ext::shared_ptr< ZeroInflationIndex > | underlyingIndex_ |
Handle< YoYInflationTermStructure > | yoyInflation_ |
Date | lastFixingDate () const |
bool | interpolated () const |
bool | ratio () const |
ext::shared_ptr< ZeroInflationIndex > | underlyingIndex () const |
Handle< YoYInflationTermStructure > | yoyInflationTermStructure () const |
ext::shared_ptr< YoYInflationIndex > | clone (const Handle< YoYInflationTermStructure > &h) const |
bool | needsForecast (const Date &fixingDate) const |
Rate | forecastFixing (const Date &fixingDate) const |
Additional Inherited Members | |
![]() | |
typedef set_type::iterator | iterator |
![]() | |
ext::shared_ptr< Observable > | notifier () const |
![]() | |
Date | referenceDate_ |
std::string | familyName_ |
Region | region_ |
bool | revised_ |
Frequency | frequency_ |
Period | availabilityLag_ |
Currency | currency_ |
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.
Definition at line 189 of file inflationindex.hpp.
|
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.
Definition at line 243 of file inflationindex.cpp.
YoYInflationIndex | ( | const ext::shared_ptr< ZeroInflationIndex > & | underlyingIndex, |
bool | interpolated, | ||
Handle< YoYInflationTermStructure > | ts = {} |
||
) |
Definition at line 254 of file inflationindex.cpp.
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.
Definition at line 261 of file inflationindex.cpp.
YoYInflationIndex | ( | const std::string & | familyName, |
const Region & | region, | ||
bool | revised, | ||
bool | interpolated, | ||
Frequency | frequency, | ||
const Period & | availabilityLag, | ||
const Currency & | currency, | ||
Handle< YoYInflationTermStructure > | ts = {} |
||
) |
Definition at line 273 of file inflationindex.cpp.
Implements InflationIndex.
Definition at line 286 of file inflationindex.cpp.
returns a past fixing at the given date
Implements InflationIndex.
Definition at line 337 of file inflationindex.cpp.
Date lastFixingDate | ( | ) | const |
bool interpolated | ( | ) | const |
bool ratio | ( | ) | const |
ext::shared_ptr< ZeroInflationIndex > underlyingIndex | ( | ) | const |
Definition at line 336 of file inflationindex.hpp.
Handle< YoYInflationTermStructure > yoyInflationTermStructure | ( | ) | const |
Definition at line 341 of file inflationindex.hpp.
ext::shared_ptr< YoYInflationIndex > clone | ( | const Handle< YoYInflationTermStructure > & | h | ) | const |
Definition at line 387 of file inflationindex.cpp.
Definition at line 306 of file inflationindex.cpp.
Definition at line 373 of file inflationindex.cpp.
|
protected |
Definition at line 262 of file inflationindex.hpp.
|
private |
Definition at line 266 of file inflationindex.hpp.
|
private |
Definition at line 267 of file inflationindex.hpp.
|
private |
Definition at line 268 of file inflationindex.hpp.