QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Member Functions | List of all members
CPICapFloorTermPriceSurface Class Referenceabstract

Provides cpi cap/floor prices by interpolation and put/call parity (not cap/floor/swap* parity). More...

#include <ql/experimental/inflation/cpicapfloortermpricesurface.hpp>

+ Inheritance diagram for CPICapFloorTermPriceSurface:
+ Collaboration diagram for CPICapFloorTermPriceSurface:

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< Seasonalityseasonality () 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 DatereferenceDate () 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 &)
 
Observeroperator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, boolregisterWith (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 &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (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< ZeroInflationIndexzii_
 
CPI::InterpolationType interpolationType_
 
Handle< YieldTermStructurenominalTS_
 
std::vector< RatecStrikes_
 
std::vector< RatefStrikes_
 
std::vector< PeriodcfMaturities_
 
std::vector< RealcfMaturityTimes_
 
Matrix cPrice_
 
Matrix fPrice_
 
std::vector< RatecfStrikes_
 
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< ZeroInflationIndexzeroInflationIndex () 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< Ratestrikes () const
 
virtual std::vector< RatecapStrikes () const
 
virtual std::vector< RatefloorStrikes () const
 
virtual std::vector< Periodmaturities () const
 
virtual const MatrixcapPrices () const
 
virtual const MatrixfloorPrices () 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< Seasonalityseasonality_
 
Period observationLag_
 
Frequency frequency_
 
Rate baseRate_
 
- Protected Attributes inherited from TermStructure
bool moving_ = false
 
bool updated_ = true
 
Calendar calendar_
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CPICapFloorTermPriceSurface()

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.

+ Here is the call graph for this function:

Member Function Documentation

◆ observationLag()

Period observationLag ( ) const
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.

+ Here is the call graph for this function:

◆ baseDate()

Date baseDate ( ) const
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.

+ Here is the call graph for this function:

◆ nominal()

Real nominal ( ) const
virtual

inspectors

Note
you don't know if price() is a cap or a floor without checking the ZeroInflation ATM level.

Definition at line 336 of file cpicapfloortermpricesurface.hpp.

◆ businessDayConvention()

BusinessDayConvention businessDayConvention ( ) const
virtual

Definition at line 341 of file cpicapfloortermpricesurface.hpp.

+ Here is the caller graph for this function:

◆ zeroInflationIndex()

ext::shared_ptr< ZeroInflationIndex > zeroInflationIndex ( ) const

Definition at line 85 of file cpicapfloortermpricesurface.hpp.

+ Here is the caller graph for this function:

◆ atmRate()

Rate atmRate ( Date  maturity) const

Definition at line 111 of file cpicapfloortermpricesurface.cpp.

+ Here is the call graph for this function:

◆ price() [1/2]

Real price ( const Period d,
Rate  k 
) const
virtual
Warning:
you MUST remind the compiler in any descendants with the using:: mechanism because you overload the names remember that the strikes use the quoting convention

Reimplemented in InterpolatedCPICapFloorTermPriceSurface< Interpolator2D >.

Definition at line 129 of file cpicapfloortermpricesurface.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ capPrice() [1/2]

Real capPrice ( const Period d,
Rate  k 
) const
virtual

Reimplemented in InterpolatedCPICapFloorTermPriceSurface< Interpolator2D >.

Definition at line 134 of file cpicapfloortermpricesurface.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ floorPrice() [1/2]

Real floorPrice ( const Period d,
Rate  k 
) const
virtual

Reimplemented in InterpolatedCPICapFloorTermPriceSurface< Interpolator2D >.

Definition at line 139 of file cpicapfloortermpricesurface.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ price() [2/2]

virtual Real price ( const Date d,
Rate  k 
) const
pure virtual

◆ capPrice() [2/2]

virtual Real capPrice ( const Date d,
Rate  k 
) const
pure virtual

◆ floorPrice() [2/2]

virtual Real floorPrice ( const Date d,
Rate  k 
) const
pure virtual

◆ strikes()

virtual std::vector< Rate > strikes ( ) const
virtual

Definition at line 102 of file cpicapfloortermpricesurface.hpp.

◆ capStrikes()

virtual std::vector< Rate > capStrikes ( ) const
virtual

Definition at line 103 of file cpicapfloortermpricesurface.hpp.

◆ floorStrikes()

virtual std::vector< Rate > floorStrikes ( ) const
virtual

Definition at line 104 of file cpicapfloortermpricesurface.hpp.

◆ maturities()

virtual std::vector< Period > maturities ( ) const
virtual

Definition at line 105 of file cpicapfloortermpricesurface.hpp.

◆ capPrices()

virtual const Matrix & capPrices ( ) const
virtual

Definition at line 107 of file cpicapfloortermpricesurface.hpp.

◆ floorPrices()

virtual const Matrix & floorPrices ( ) const
virtual

Definition at line 108 of file cpicapfloortermpricesurface.hpp.

◆ minStrike()

virtual Rate minStrike ( ) const
virtual

Definition at line 110 of file cpicapfloortermpricesurface.hpp.

+ Here is the caller graph for this function:

◆ maxStrike()

virtual Rate maxStrike ( ) const
virtual

Definition at line 111 of file cpicapfloortermpricesurface.hpp.

+ Here is the caller graph for this function:

◆ minDate()

virtual Date minDate ( ) const
virtual

Definition at line 112 of file cpicapfloortermpricesurface.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maxDate()

Date maxDate ( ) const
overridevirtual

the latest date for which the curve can return values

Implements TermStructure.

Definition at line 113 of file cpicapfloortermpricesurface.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cpiOptionDateFromTenor()

Date cpiOptionDateFromTenor ( const Period p) const
virtual

Definition at line 123 of file cpicapfloortermpricesurface.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkStrike()

virtual bool checkStrike ( Rate  K)
protectedvirtual

Definition at line 119 of file cpicapfloortermpricesurface.hpp.

+ Here is the call graph for this function:

◆ checkMaturity()

virtual bool checkMaturity ( const Date d)
protectedvirtual

Definition at line 122 of file cpicapfloortermpricesurface.hpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ zii_

ext::shared_ptr<ZeroInflationIndex> zii_
protected

Definition at line 126 of file cpicapfloortermpricesurface.hpp.

◆ interpolationType_

CPI::InterpolationType interpolationType_
protected

Definition at line 127 of file cpicapfloortermpricesurface.hpp.

◆ nominalTS_

Handle<YieldTermStructure> nominalTS_
protected

Definition at line 128 of file cpicapfloortermpricesurface.hpp.

◆ cStrikes_

std::vector<Rate> cStrikes_
protected

Definition at line 130 of file cpicapfloortermpricesurface.hpp.

◆ fStrikes_

std::vector<Rate> fStrikes_
protected

Definition at line 131 of file cpicapfloortermpricesurface.hpp.

◆ cfMaturities_

std::vector<Period> cfMaturities_
protected

Definition at line 132 of file cpicapfloortermpricesurface.hpp.

◆ cfMaturityTimes_

std::vector<Real> cfMaturityTimes_
mutableprotected

Definition at line 133 of file cpicapfloortermpricesurface.hpp.

◆ cPrice_

Matrix cPrice_
protected

Definition at line 134 of file cpicapfloortermpricesurface.hpp.

◆ fPrice_

Matrix fPrice_
protected

Definition at line 135 of file cpicapfloortermpricesurface.hpp.

◆ cfStrikes_

std::vector<Rate> cfStrikes_
mutableprotected

Definition at line 137 of file cpicapfloortermpricesurface.hpp.

◆ nominal_

Real nominal_
private

Definition at line 139 of file cpicapfloortermpricesurface.hpp.

◆ bdc_

BusinessDayConvention bdc_
private

Definition at line 140 of file cpicapfloortermpricesurface.hpp.