QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
|
Provides cpi cap/floor prices by interpolation and put/call parity (not cap/floor/swap* parity). More...
#include <ql/experimental/inflation/cpicapfloortermpricesurface.hpp>
Public Member Functions | |
CPICapFloorTermPriceSurface (Real nominal, Real baseRate, const Period &observationLag, const Calendar &cal, const BusinessDayConvention &bdc, const DayCounter &dc, const ext::shared_ptr< ZeroInflationIndex > &zii, CPI::InterpolationType interpolationType, Handle< YieldTermStructure > yts, const std::vector< Rate > &cStrikes, const std::vector< Rate > &fStrikes, const std::vector< Period > &cfMaturities, const Matrix &cPrice, const Matrix &fPrice) | |
Public Member Functions inherited from InflationTermStructure | |
InflationTermStructure (Rate baseRate, const Period &observationLag, Frequency frequency, const DayCounter &dayCounter=DayCounter(), ext::shared_ptr< Seasonality > seasonality={}) | |
InflationTermStructure (const Date &referenceDate, Rate baseRate, const Period &observationLag, Frequency frequency, const Calendar &calendar=Calendar(), const DayCounter &dayCounter=DayCounter(), ext::shared_ptr< Seasonality > seasonality={}) | |
InflationTermStructure (Natural settlementDays, const Calendar &calendar, Rate baseRate, const Period &observationLag, Frequency frequency, const DayCounter &dayCounter=DayCounter(), ext::shared_ptr< Seasonality > seasonality={}) | |
virtual Frequency | frequency () const |
virtual Rate | baseRate () const |
void | setSeasonality (const ext::shared_ptr< Seasonality > &seasonality={}) |
Functions to set and get seasonality. More... | |
ext::shared_ptr< Seasonality > | seasonality () const |
bool | hasSeasonality () const |
Public Member Functions inherited from TermStructure | |
TermStructure (DayCounter dc=DayCounter()) | |
default constructor More... | |
TermStructure (const Date &referenceDate, Calendar calendar=Calendar(), DayCounter dc=DayCounter()) | |
initialize with a fixed reference date More... | |
TermStructure (Natural settlementDays, Calendar, DayCounter dc=DayCounter()) | |
calculate the reference date based on the global evaluation date More... | |
~TermStructure () override=default | |
virtual DayCounter | dayCounter () const |
the day counter used for date/time conversion More... | |
Time | timeFromReference (const Date &date) const |
date/time conversion More... | |
virtual Time | maxTime () const |
the latest time for which the curve can return values More... | |
virtual const Date & | referenceDate () const |
the date at which discount = 1.0 and/or variance = 0.0 More... | |
virtual Calendar | calendar () const |
the calendar used for reference and/or option date calculation More... | |
virtual Natural | settlementDays () const |
the settlementDays used for reference date calculation More... | |
void | update () override |
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 () |
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 Extrapolator | |
Extrapolator ()=default | |
virtual | ~Extrapolator ()=default |
void | enableExtrapolation (bool b=true) |
enable extrapolation in subsequent calls More... | |
void | disableExtrapolation (bool b=true) |
disable extrapolation in subsequent calls More... | |
bool | allowsExtrapolation () const |
tells whether extrapolation is enabled More... | |
InflationTermStructure interface | |
ext::shared_ptr< ZeroInflationIndex > | zii_ |
CPI::InterpolationType | interpolationType_ |
Handle< YieldTermStructure > | nominalTS_ |
std::vector< Rate > | cStrikes_ |
std::vector< Rate > | fStrikes_ |
std::vector< Period > | cfMaturities_ |
std::vector< Real > | cfMaturityTimes_ |
Matrix | cPrice_ |
Matrix | fPrice_ |
std::vector< Rate > | cfStrikes_ |
Real | nominal_ |
BusinessDayConvention | bdc_ |
Period | observationLag () const override |
Date | baseDate () const override |
minimum (base) date More... | |
virtual Real | nominal () const |
inspectors More... | |
virtual BusinessDayConvention | businessDayConvention () const |
ext::shared_ptr< ZeroInflationIndex > | zeroInflationIndex () const |
Rate | atmRate (Date maturity) const |
virtual Real | price (const Period &d, Rate k) const |
virtual Real | capPrice (const Period &d, Rate k) const |
virtual Real | floorPrice (const Period &d, Rate k) const |
virtual Real | price (const Date &d, Rate k) const =0 |
virtual Real | capPrice (const Date &d, Rate k) const =0 |
virtual Real | floorPrice (const Date &d, Rate k) const =0 |
virtual std::vector< Rate > | strikes () const |
virtual std::vector< Rate > | capStrikes () const |
virtual std::vector< Rate > | floorStrikes () const |
virtual std::vector< Period > | maturities () const |
virtual const Matrix & | capPrices () const |
virtual const Matrix & | floorPrices () const |
virtual Rate | minStrike () const |
virtual Rate | maxStrike () const |
virtual Date | minDate () const |
Date | maxDate () const override |
the latest date for which the curve can return values More... | |
virtual Date | cpiOptionDateFromTenor (const Period &p) const |
virtual bool | checkStrike (Rate K) |
virtual bool | checkMaturity (const Date &d) |
Additional Inherited Members | |
Public Types inherited from Observer | |
typedef set_type::iterator | iterator |
Protected Member Functions inherited from InflationTermStructure | |
virtual void | setBaseRate (const Rate &r) |
void | checkRange (const Date &, bool extrapolate) const |
void | checkRange (Time t, bool extrapolate) const |
Protected Member Functions inherited from TermStructure | |
void | checkRange (const Date &d, bool extrapolate) const |
date-range check More... | |
void | checkRange (Time t, bool extrapolate) const |
time-range check More... | |
Protected Attributes inherited from InflationTermStructure | |
ext::shared_ptr< Seasonality > | seasonality_ |
Period | observationLag_ |
Frequency | frequency_ |
Rate | baseRate_ |
Protected Attributes inherited from TermStructure | |
bool | moving_ = false |
bool | updated_ = true |
Calendar | calendar_ |
Provides cpi cap/floor prices by interpolation and put/call parity (not cap/floor/swap* parity).
The inflation index MUST contain a ZeroInflationTermStructure as this is used to create ATM. Unlike YoY price surfaces we assume that 1) an ATM ZeroInflationTermStructure is available and 2) that it is safe to use it. This is supported by the fact that no stripping is required for CPI cap/floors as they only give one flow.
cpi cap/floors have a single (one) flow (unlike nominal caps) because they observe cumulative inflation up to their maturity. Options are on CPI(T)/CPI(0) but strikes are quoted for yearly average inflation, so require transformation via (1+quote)^T to obtain actual strikes. These are consistent with ZCIIS quoting conventions.
The observationLag is that for the referenced instrument prices. Strikes are as-quoted not as-used.
Definition at line 54 of file cpicapfloortermpricesurface.hpp.
CPICapFloorTermPriceSurface | ( | Real | nominal, |
Real | baseRate, | ||
const Period & | observationLag, | ||
const Calendar & | cal, | ||
const BusinessDayConvention & | bdc, | ||
const DayCounter & | dc, | ||
const ext::shared_ptr< ZeroInflationIndex > & | zii, | ||
CPI::InterpolationType | interpolationType, | ||
Handle< YieldTermStructure > | yts, | ||
const std::vector< Rate > & | cStrikes, | ||
const std::vector< Rate > & | fStrikes, | ||
const std::vector< Period > & | cfMaturities, | ||
const Matrix & | cPrice, | ||
const Matrix & | fPrice | ||
) |
Definition at line 27 of file cpicapfloortermpricesurface.cpp.
|
overridevirtual |
The TS observes with a lag that is usually different from the availability lag of the index. An inflation rate is given, by default, for the maturity requested assuming this lag.
Reimplemented from InflationTermStructure.
Definition at line 328 of file cpicapfloortermpricesurface.hpp.
|
overridevirtual |
minimum (base) date
Important in inflation since it starts before nominal reference date. Changes depending whether index is interpolated or not. When interpolated the base date is just observation lag before nominal. When not interpolated it is the beginning of the relevant period (hence it is easy to create interpolated fixings from a not-interpolated curve because interpolation, usually, of fixings is forward looking).
Implements InflationTermStructure.
Definition at line 332 of file cpicapfloortermpricesurface.hpp.
|
virtual |
inspectors
Definition at line 336 of file cpicapfloortermpricesurface.hpp.
|
virtual |
Definition at line 341 of file cpicapfloortermpricesurface.hpp.
ext::shared_ptr< ZeroInflationIndex > zeroInflationIndex | ( | ) | const |
Definition at line 85 of file cpicapfloortermpricesurface.hpp.
Definition at line 111 of file cpicapfloortermpricesurface.cpp.
Reimplemented in InterpolatedCPICapFloorTermPriceSurface< Interpolator2D >.
Definition at line 129 of file cpicapfloortermpricesurface.cpp.
Reimplemented in InterpolatedCPICapFloorTermPriceSurface< Interpolator2D >.
Definition at line 134 of file cpicapfloortermpricesurface.cpp.
Reimplemented in InterpolatedCPICapFloorTermPriceSurface< Interpolator2D >.
Definition at line 139 of file cpicapfloortermpricesurface.cpp.
|
virtual |
Definition at line 102 of file cpicapfloortermpricesurface.hpp.
|
virtual |
Definition at line 103 of file cpicapfloortermpricesurface.hpp.
|
virtual |
Definition at line 104 of file cpicapfloortermpricesurface.hpp.
|
virtual |
Definition at line 105 of file cpicapfloortermpricesurface.hpp.
|
virtual |
Definition at line 107 of file cpicapfloortermpricesurface.hpp.
|
virtual |
Definition at line 108 of file cpicapfloortermpricesurface.hpp.
|
virtual |
Definition at line 110 of file cpicapfloortermpricesurface.hpp.
|
virtual |
Definition at line 111 of file cpicapfloortermpricesurface.hpp.
|
virtual |
Definition at line 112 of file cpicapfloortermpricesurface.hpp.
|
overridevirtual |
the latest date for which the curve can return values
Implements TermStructure.
Definition at line 113 of file cpicapfloortermpricesurface.hpp.
Definition at line 123 of file cpicapfloortermpricesurface.cpp.
Definition at line 119 of file cpicapfloortermpricesurface.hpp.
Definition at line 122 of file cpicapfloortermpricesurface.hpp.
|
protected |
Definition at line 126 of file cpicapfloortermpricesurface.hpp.
|
protected |
Definition at line 127 of file cpicapfloortermpricesurface.hpp.
|
protected |
Definition at line 128 of file cpicapfloortermpricesurface.hpp.
|
protected |
Definition at line 130 of file cpicapfloortermpricesurface.hpp.
|
protected |
Definition at line 131 of file cpicapfloortermpricesurface.hpp.
|
protected |
Definition at line 132 of file cpicapfloortermpricesurface.hpp.
|
mutableprotected |
Definition at line 133 of file cpicapfloortermpricesurface.hpp.
|
protected |
Definition at line 134 of file cpicapfloortermpricesurface.hpp.
|
protected |
Definition at line 135 of file cpicapfloortermpricesurface.hpp.
|
mutableprotected |
Definition at line 137 of file cpicapfloortermpricesurface.hpp.
|
private |
Definition at line 139 of file cpicapfloortermpricesurface.hpp.
|
private |
Definition at line 140 of file cpicapfloortermpricesurface.hpp.