Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
CPIVolatilitySurface Class Referenceabstract

#include <qle/termstructures/inflation/cpivolatilitystructure.hpp>

+ Inheritance diagram for CPIVolatilitySurface:
+ Collaboration diagram for CPIVolatilitySurface:

Public Member Functions

 CPIVolatilitySurface (QuantLib::Natural settlementDays, const QuantLib::Calendar &, QuantLib::BusinessDayConvention bdc, const QuantLib::DayCounter &dc, const QuantLib::Period &observationLag, QuantLib::Frequency frequency, bool indexIsInterpolated, const QuantLib::Date &capFloorStartDate=QuantLib::Date(), QuantLib::VolatilityType volType=QuantLib::ShiftedLognormal, double displacement=0.0)
 
QuantLib::Date optionDateFromTenor (const QuantLib::Period &tenor) const override
 Computes the expiry date from the capFloorStartDate() More...
 
QuantLib::Date baseDate () const override
 base date will be in the past More...
 
QuantLib::VolatilityType volatilityType () const
 Returns the volatility type. More...
 
double displacement () const
 Returns the displacement for lognormal volatilities. More...
 
bool isLogNormal () const
 
QuantLib::Volatility volatility (const QuantLib::Date &maturityDate, QuantLib::Rate strike, const QuantLib::Period &obsLag=QuantLib::Period(-1, QuantLib::Days), bool extrapolate=false) const override
 
virtual QuantLib::Real atmStrike (const QuantLib::Date &maturity, const QuantLib::Period &obsLag=QuantLib::Period(-1, QuantLib::Days)) const =0
 
QuantLib::Date capFloorStartDate () const
 

Protected Member Functions

virtual double fixingTime (const QuantLib::Date &maturityDate) const
 Computes the expiry time from the capFloorStartDate() More...
 

Protected Attributes

QuantLib::VolatilityType volType_
 
double displacement_
 

Private Attributes

QuantLib::Date capFloorStartDate_
 

Detailed Description

Abstract interface. CPI volatility is always with respect to some base date of the quoted Zero Coupon Caps and Floor. Also deal with lagged observations of an index with a (usually different) availability lag.

Definition at line 35 of file cpivolatilitystructure.hpp.

Constructor & Destructor Documentation

◆ CPIVolatilitySurface()

CPIVolatilitySurface ( QuantLib::Natural  settlementDays,
const QuantLib::Calendar &  cal,
QuantLib::BusinessDayConvention  bdc,
const QuantLib::DayCounter &  dc,
const QuantLib::Period &  observationLag,
QuantLib::Frequency  frequency,
bool  indexIsInterpolated,
const QuantLib::Date &  capFloorStartDate = QuantLib::Date(),
QuantLib::VolatilityType  volType = QuantLib::ShiftedLognormal,
double  displacement = 0.0 
)

the capfloor startdate is the start date of the quoted market instruments, usually its today, but it could be in the future (e.g. AUCPI)

Definition at line 25 of file cpivolatilitystructure.cpp.

30 : QuantLib::CPIVolatilitySurface(settlementDays, cal, bdc, dc, observationLag, frequency, indexIsInterpolated),
double displacement() const
Returns the displacement for lognormal volatilities.

Member Function Documentation

◆ optionDateFromTenor()

QuantLib::Date optionDateFromTenor ( const QuantLib::Period &  tenor) const
override

Computes the expiry date from the capFloorStartDate()

Definition at line 41 of file cpivolatilitystructure.cpp.

41 {
42 return calendar().advance(capFloorStartDate(), tenor, businessDayConvention());
43}
QuantLib::Date capFloorStartDate() const
+ Here is the call graph for this function:

◆ baseDate()

QuantLib::Date baseDate ( ) const
override

base date will be in the past

Definition at line 45 of file cpivolatilitystructure.cpp.

45 {
46 // Depends on interpolation, or not, of observed index
47 // and observation lag with which it was built.
48 // We want this to work even if the index does not
49 // have a term structure.
50 if (indexIsInterpolated()) {
51 return capFloorStartDate() - observationLag();
52 } else {
53 return QuantLib::inflationPeriod(capFloorStartDate() - observationLag(), frequency()).first;
54 }
55}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ volatilityType()

QuantLib::VolatilityType volatilityType ( ) const

Returns the volatility type.

Definition at line 53 of file cpivolatilitystructure.hpp.

53{ return volType_; }
+ Here is the caller graph for this function:

◆ displacement()

double displacement ( ) const

Returns the displacement for lognormal volatilities.

Definition at line 55 of file cpivolatilitystructure.hpp.

55{ return displacement_; }

◆ isLogNormal()

bool isLogNormal ( ) const

Definition at line 57 of file cpivolatilitystructure.hpp.

57{ return volatilityType() == QuantLib::ShiftedLognormal; }
QuantLib::VolatilityType volatilityType() const
Returns the volatility type.
+ Here is the call graph for this function:

◆ volatility()

QuantLib::Volatility volatility ( const QuantLib::Date &  maturityDate,
QuantLib::Rate  strike,
const QuantLib::Period &  obsLag = QuantLib::Period(-1, QuantLib::Days),
bool  extrapolate = false 
) const
override

Definition at line 61 of file cpivolatilitystructure.cpp.

62 {
63 if (strike == QuantLib::Null<QuantLib::Real>()) {
64 strike = atmStrike(maturityDate, obsLag);
65 }
66 return QuantLib::CPIVolatilitySurface::volatility(maturityDate, strike, obsLag, extrapolate);
67}
virtual QuantLib::Real atmStrike(const QuantLib::Date &maturity, const QuantLib::Period &obsLag=QuantLib::Period(-1, QuantLib::Days)) const =0
+ Here is the call graph for this function:

◆ atmStrike()

virtual QuantLib::Real atmStrike ( const QuantLib::Date &  maturity,
const QuantLib::Period &  obsLag = QuantLib::Period(-1, QuantLib::Days) 
) const
pure virtual

◆ capFloorStartDate()

QuantLib::Date capFloorStartDate ( ) const

Definition at line 33 of file cpivolatilitystructure.cpp.

33 {
34 if (capFloorStartDate_ == QuantLib::Date()) {
35 return referenceDate();
36 } else {
37 return capFloorStartDate_;
38 }
39}
+ Here is the caller graph for this function:

◆ fixingTime()

double fixingTime ( const QuantLib::Date &  maturityDate) const
protectedvirtual

Computes the expiry time from the capFloorStartDate()

Definition at line 57 of file cpivolatilitystructure.cpp.

57 {
58 return timeFromReference(ZeroInflation::fixingDate(maturityDate, observationLag(), frequency(), indexIsInterpolated()));
59}
QuantLib::Date fixingDate(const QuantLib::Date &d, const QuantLib::Period obsLag, const QuantLib::Frequency freq, bool interpolated)
Definition: inflation.cpp:183
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ volType_

QuantLib::VolatilityType volType_
protected

Definition at line 77 of file cpivolatilitystructure.hpp.

◆ displacement_

double displacement_
protected

Definition at line 78 of file cpivolatilitystructure.hpp.

◆ capFloorStartDate_

QuantLib::Date capFloorStartDate_
private

Definition at line 81 of file cpivolatilitystructure.hpp.