QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
YoYCapFloorTermPriceSurface Class Referenceabstract

Abstract base class, inheriting from InflationTermStructure. More...

#include <yoycapfloortermpricesurface.hpp>

+ Inheritance diagram for YoYCapFloorTermPriceSurface:
+ Collaboration diagram for YoYCapFloorTermPriceSurface:

Public Member Functions

 YoYCapFloorTermPriceSurface (Natural fixingDays, const Period &yyLag, const ext::shared_ptr< YoYInflationIndex > &yii, CPI::InterpolationType interpolation, Handle< YieldTermStructure > nominal, const DayCounter &dc, const Calendar &cal, const BusinessDayConvention &bdc, const std::vector< Rate > &cStrikes, const std::vector< Rate > &fStrikes, const std::vector< Period > &cfMaturities, const Matrix &cPrice, const Matrix &fPrice)
 
 YoYCapFloorTermPriceSurface (Natural fixingDays, const Period &yyLag, const ext::shared_ptr< YoYInflationIndex > &yii, Rate baseRate, Handle< YieldTermStructure > nominal, const DayCounter &dc, const Calendar &cal, const BusinessDayConvention &bdc, const std::vector< Rate > &cStrikes, const std::vector< Rate > &fStrikes, const std::vector< Period > &cfMaturities, const Matrix &cPrice, const Matrix &fPrice)
 
bool indexIsInterpolated () const
 
virtual Period observationLag () const
 
virtual Frequency frequency () const
 
virtual std::pair< std::vector< Time >, std::vector< Rate > > atmYoYSwapTimeRates () const =0
 atm yoy swaps from put-call parity on cap/floor data More...
 
virtual std::pair< std::vector< Date >, std::vector< Rate > > atmYoYSwapDateRates () const =0
 
virtual ext::shared_ptr< YoYInflationTermStructureYoYTS () const =0
 derived from yoy swap rates More...
 
ext::shared_ptr< YoYInflationIndexyoyIndex () const
 index yoy is based on More...
 
virtual BusinessDayConvention businessDayConvention () const
 inspectors More...
 
virtual Natural fixingDays () const
 
virtual Date baseDate () const =0
 
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 Rate atmYoYSwapRate (const Date &d, bool extrapolate=true) const =0
 
virtual Rate atmYoYRate (const Date &d, const Period &obsLag=Period(-1, Days), bool extrapolate=true) const =0
 
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 Rate atmYoYSwapRate (const Period &d, bool extrapolate=true) const
 
virtual Rate atmYoYRate (const Period &d, const Period &obsLag=Period(-1, Days), bool extrapolate=true) const
 
virtual std::vector< Ratestrikes () const
 
virtual std::vector< RatecapStrikes () const
 
virtual std::vector< RatefloorStrikes () const
 
virtual std::vector< Periodmaturities () const
 
virtual Rate minStrike () const
 
virtual Rate maxStrike () const
 
virtual Date minMaturity () const
 
virtual Date maxMaturity () const
 
virtual Date yoyOptionDateFromTenor (const Period &p) 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 Date maxDate () const =0
 the latest date for which the curve can return values 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 ()=default
 
 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...
 

Protected Member Functions

virtual bool checkStrike (Rate K)
 
virtual bool checkMaturity (const Date &d)
 
- 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

Natural fixingDays_
 
BusinessDayConvention bdc_
 
ext::shared_ptr< YoYInflationIndexyoyIndex_
 
Period observationLag_
 
Handle< YieldTermStructurenominalTS_
 
std::vector< RatecStrikes_
 
std::vector< RatefStrikes_
 
std::vector< PeriodcfMaturities_
 
std::vector< RealcfMaturityTimes_
 
Matrix cPrice_
 
Matrix fPrice_
 
bool indexIsInterpolated_
 
std::vector< RatecfStrikes_
 
ext::shared_ptr< YoYInflationTermStructureyoy_
 
std::pair< std::vector< Time >, std::vector< Rate > > atmYoYSwapTimeRates_
 
std::pair< std::vector< Date >, std::vector< Rate > > atmYoYSwapDateRates_
 
- Protected Attributes inherited from TermStructure
bool moving_ = false
 
bool updated_ = true
 
Calendar calendar_
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 

Detailed Description

Abstract base class, inheriting from InflationTermStructure.

Since this can create a yoy term structure it does take a YoY index.

Definition at line 42 of file yoycapfloortermpricesurface.hpp.

Constructor & Destructor Documentation

◆ YoYCapFloorTermPriceSurface() [1/2]

YoYCapFloorTermPriceSurface ( Natural  fixingDays,
const Period yyLag,
const ext::shared_ptr< YoYInflationIndex > &  yii,
CPI::InterpolationType  interpolation,
Handle< YieldTermStructure nominal,
const DayCounter dc,
const Calendar cal,
const BusinessDayConvention bdc,
const std::vector< Rate > &  cStrikes,
const std::vector< Rate > &  fStrikes,
const std::vector< Period > &  cfMaturities,
const Matrix cPrice,
const Matrix fPrice 
)

Definition at line 25 of file yoycapfloortermpricesurface.cpp.

+ Here is the call graph for this function:

◆ YoYCapFloorTermPriceSurface() [2/2]

YoYCapFloorTermPriceSurface ( Natural  fixingDays,
const Period yyLag,
const ext::shared_ptr< YoYInflationIndex > &  yii,
Rate  baseRate,
Handle< YieldTermStructure nominal,
const DayCounter dc,
const Calendar cal,
const BusinessDayConvention bdc,
const std::vector< Rate > &  cStrikes,
const std::vector< Rate > &  fStrikes,
const std::vector< Period > &  cfMaturities,
const Matrix cPrice,
const Matrix fPrice 
)
Deprecated:
Use the overload that passes an interpolation type instead. Deprecated in version 1.36.

Definition at line 103 of file yoycapfloortermpricesurface.cpp.

Member Function Documentation

◆ indexIsInterpolated()

bool indexIsInterpolated ( ) const

Definition at line 277 of file yoycapfloortermpricesurface.hpp.

+ Here is the caller graph for this function:

◆ observationLag()

Period observationLag ( ) const
virtual

Definition at line 281 of file yoycapfloortermpricesurface.hpp.

+ Here is the caller graph for this function:

◆ frequency()

Frequency frequency ( ) const
virtual

Definition at line 285 of file yoycapfloortermpricesurface.hpp.

+ Here is the caller graph for this function:

◆ atmYoYSwapTimeRates()

virtual std::pair< std::vector< Time >, std::vector< Rate > > atmYoYSwapTimeRates ( ) const
pure virtual

atm yoy swaps from put-call parity on cap/floor data

uses interpolation (on surface price data), yearly maturities.

Implemented in InterpolatedYoYCapFloorTermPriceSurface< Interpolator2D, Interpolator1D >.

◆ atmYoYSwapDateRates()

virtual std::pair< std::vector< Date >, std::vector< Rate > > atmYoYSwapDateRates ( ) const
pure virtual

◆ YoYTS()

virtual ext::shared_ptr< YoYInflationTermStructure > YoYTS ( ) const
pure virtual

◆ yoyIndex()

ext::shared_ptr< YoYInflationIndex > yoyIndex ( ) const

index yoy is based on

Definition at line 90 of file yoycapfloortermpricesurface.hpp.

+ Here is the caller graph for this function:

◆ businessDayConvention()

virtual BusinessDayConvention businessDayConvention ( ) const
virtual

inspectors

Note
you don't know if price() is a cap or a floor without checking the YoYSwapATM level.
atm cap/floor prices are generally inaccurate because they are from extrapolation and intersection.

Definition at line 100 of file yoycapfloortermpricesurface.hpp.

◆ fixingDays()

virtual Natural fixingDays ( ) const
virtual

◆ baseDate()

virtual Date baseDate ( ) const
pure virtual

◆ price() [1/2]

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

Implemented in InterpolatedYoYCapFloorTermPriceSurface< Interpolator2D, Interpolator1D >.

+ Here is the caller graph for this function:

◆ capPrice() [1/2]

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

Implemented in InterpolatedYoYCapFloorTermPriceSurface< Interpolator2D, Interpolator1D >.

+ Here is the caller graph for this function:

◆ floorPrice() [1/2]

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

Implemented in InterpolatedYoYCapFloorTermPriceSurface< Interpolator2D, Interpolator1D >.

+ Here is the caller graph for this function:

◆ atmYoYSwapRate() [1/2]

virtual Rate atmYoYSwapRate ( const Date d,
bool  extrapolate = true 
) const
pure virtual

Implemented in InterpolatedYoYCapFloorTermPriceSurface< Interpolator2D, Interpolator1D >.

+ Here is the caller graph for this function:

◆ atmYoYRate() [1/2]

virtual Rate atmYoYRate ( const Date d,
const Period obsLag = Period(-1, Days),
bool  extrapolate = true 
) const
pure virtual

Implemented in InterpolatedYoYCapFloorTermPriceSurface< Interpolator2D, Interpolator1D >.

+ Here is the caller graph for this function:

◆ price() [2/2]

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

Definition at line 125 of file yoycapfloortermpricesurface.cpp.

+ Here is the call graph for this function:

◆ capPrice() [2/2]

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

Definition at line 129 of file yoycapfloortermpricesurface.cpp.

+ Here is the call graph for this function:

◆ floorPrice() [2/2]

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

Definition at line 133 of file yoycapfloortermpricesurface.cpp.

+ Here is the call graph for this function:

◆ atmYoYSwapRate() [2/2]

Rate atmYoYSwapRate ( const Period d,
bool  extrapolate = true 
) const
virtual

Definition at line 137 of file yoycapfloortermpricesurface.cpp.

+ Here is the call graph for this function:

◆ atmYoYRate() [2/2]

Rate atmYoYRate ( const Period d,
const Period obsLag = Period(-1,Days),
bool  extrapolate = true 
) const
virtual

Definition at line 142 of file yoycapfloortermpricesurface.cpp.

+ Here is the call graph for this function:

◆ strikes()

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

Definition at line 121 of file yoycapfloortermpricesurface.hpp.

◆ capStrikes()

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

Definition at line 122 of file yoycapfloortermpricesurface.hpp.

◆ floorStrikes()

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

Definition at line 123 of file yoycapfloortermpricesurface.hpp.

◆ maturities()

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

Definition at line 124 of file yoycapfloortermpricesurface.hpp.

◆ minStrike()

virtual Rate minStrike ( ) const
virtual

Definition at line 125 of file yoycapfloortermpricesurface.hpp.

+ Here is the caller graph for this function:

◆ maxStrike()

virtual Rate maxStrike ( ) const
virtual

Definition at line 126 of file yoycapfloortermpricesurface.hpp.

+ Here is the caller graph for this function:

◆ minMaturity()

virtual Date minMaturity ( ) const
virtual

Definition at line 127 of file yoycapfloortermpricesurface.hpp.

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

◆ maxMaturity()

virtual Date maxMaturity ( ) const
virtual

Definition at line 128 of file yoycapfloortermpricesurface.hpp.

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

◆ yoyOptionDateFromTenor()

Date yoyOptionDateFromTenor ( const Period p) const
virtual

Definition at line 120 of file yoycapfloortermpricesurface.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 134 of file yoycapfloortermpricesurface.hpp.

+ Here is the call graph for this function:

◆ checkMaturity()

virtual bool checkMaturity ( const Date d)
protectedvirtual

Definition at line 137 of file yoycapfloortermpricesurface.hpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ fixingDays_

Natural fixingDays_
protected

Definition at line 145 of file yoycapfloortermpricesurface.hpp.

◆ bdc_

BusinessDayConvention bdc_
protected

Definition at line 146 of file yoycapfloortermpricesurface.hpp.

◆ yoyIndex_

ext::shared_ptr<YoYInflationIndex> yoyIndex_
protected

Definition at line 147 of file yoycapfloortermpricesurface.hpp.

◆ observationLag_

Period observationLag_
protected

Definition at line 148 of file yoycapfloortermpricesurface.hpp.

◆ nominalTS_

Handle<YieldTermStructure> nominalTS_
protected

Definition at line 149 of file yoycapfloortermpricesurface.hpp.

◆ cStrikes_

std::vector<Rate> cStrikes_
protected

Definition at line 151 of file yoycapfloortermpricesurface.hpp.

◆ fStrikes_

std::vector<Rate> fStrikes_
protected

Definition at line 152 of file yoycapfloortermpricesurface.hpp.

◆ cfMaturities_

std::vector<Period> cfMaturities_
protected

Definition at line 153 of file yoycapfloortermpricesurface.hpp.

◆ cfMaturityTimes_

std::vector<Real> cfMaturityTimes_
mutableprotected

Definition at line 154 of file yoycapfloortermpricesurface.hpp.

◆ cPrice_

Matrix cPrice_
protected

Definition at line 155 of file yoycapfloortermpricesurface.hpp.

◆ fPrice_

Matrix fPrice_
protected

Definition at line 156 of file yoycapfloortermpricesurface.hpp.

◆ indexIsInterpolated_

bool indexIsInterpolated_
protected

Definition at line 157 of file yoycapfloortermpricesurface.hpp.

◆ cfStrikes_

std::vector<Rate> cfStrikes_
mutableprotected

Definition at line 159 of file yoycapfloortermpricesurface.hpp.

◆ yoy_

ext::shared_ptr<YoYInflationTermStructure> yoy_
mutableprotected

Definition at line 160 of file yoycapfloortermpricesurface.hpp.

◆ atmYoYSwapTimeRates_

std::pair<std::vector<Time>, std::vector<Rate> > atmYoYSwapTimeRates_
mutableprotected

Definition at line 161 of file yoycapfloortermpricesurface.hpp.

◆ atmYoYSwapDateRates_

std::pair<std::vector<Date>, std::vector<Rate> > atmYoYSwapDateRates_
mutableprotected

Definition at line 162 of file yoycapfloortermpricesurface.hpp.