Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SwaptionVolatilityConstantSpread Class Reference

Swaption cube that combines an ATM matrix and vol spreads from a cube. More...

#include <qle/termstructures/swaptionvolconstantspread.hpp>

+ Inheritance diagram for SwaptionVolatilityConstantSpread:
+ Collaboration diagram for SwaptionVolatilityConstantSpread:

Public Member Functions

 SwaptionVolatilityConstantSpread (const Handle< SwaptionVolatilityStructure > &atm, const Handle< SwaptionVolatilityStructure > &cube)
 
TermStructure interface
DayCounter dayCounter () const override
 
Date maxDate () const override
 
Time maxTime () const override
 
const Date & referenceDate () const override
 
Calendar calendar () const override
 
Natural settlementDays () const override
 
VolatilityTermStructure interface
Rate minStrike () const override
 
Rate maxStrike () const override
 
SwaptionVolatilityStructure interface
const Period & maxSwapTenor () const override
 
VolatilityType volatilityType () const override
 

Observer interface

Handle< SwaptionVolatilityStructureatm_
 
Handle< SwaptionVolatilityStructurecube_
 
void deepUpdate () override
 
const Handle< SwaptionVolatilityStructure > & atmVol ()
 
const Handle< SwaptionVolatilityStructure > & cube ()
 
QuantLib::ext::shared_ptr< SmileSection > smileSectionImpl (Time optionTime, Time swapLength) const override
 
Volatility volatilityImpl (Time optionTime, Time swapLength, Rate strike) const override
 

Detailed Description

Swaption cube that combines an ATM matrix and vol spreads from a cube.

Notice that the TS has a floating reference date and accesses the source TS only via their time-based volatility methods.

Warning:

the given atm vol structure should be strike independent, this is not checked

the given cube must provide smile sections that provide an ATM level

Definition at line 69 of file swaptionvolconstantspread.hpp.

Constructor & Destructor Documentation

◆ SwaptionVolatilityConstantSpread()

SwaptionVolatilityConstantSpread ( const Handle< SwaptionVolatilityStructure > &  atm,
const Handle< SwaptionVolatilityStructure > &  cube 
)

Definition at line 71 of file swaptionvolconstantspread.hpp.

73 : SwaptionVolatilityStructure(0, atm->calendar(), atm->businessDayConvention(), atm->dayCounter()), atm_(atm),
74 cube_(cube) {
75 enableExtrapolation(atm->allowsExtrapolation());
76 registerWith(atm_);
77 registerWith(cube_);
78 }
Handle< SwaptionVolatilityStructure > cube_
const Handle< SwaptionVolatilityStructure > & cube()
Handle< SwaptionVolatilityStructure > atm_

Member Function Documentation

◆ dayCounter()

DayCounter dayCounter ( ) const
override

Definition at line 82 of file swaptionvolconstantspread.hpp.

82{ return atm_->dayCounter(); }

◆ maxDate()

Date maxDate ( ) const
override

Definition at line 83 of file swaptionvolconstantspread.hpp.

83{ return atm_->maxDate(); }

◆ maxTime()

Time maxTime ( ) const
override

Definition at line 84 of file swaptionvolconstantspread.hpp.

84{ return atm_->maxTime(); }

◆ referenceDate()

const Date & referenceDate ( ) const
override

Definition at line 85 of file swaptionvolconstantspread.hpp.

85{ return atm_->referenceDate(); }

◆ calendar()

Calendar calendar ( ) const
override

Definition at line 86 of file swaptionvolconstantspread.hpp.

86{ return atm_->calendar(); }

◆ settlementDays()

Natural settlementDays ( ) const
override

Definition at line 87 of file swaptionvolconstantspread.hpp.

87{ return atm_->settlementDays(); }

◆ minStrike()

Rate minStrike ( ) const
override

Definition at line 90 of file swaptionvolconstantspread.hpp.

90{ return cube_->minStrike(); }

◆ maxStrike()

Rate maxStrike ( ) const
override

Definition at line 91 of file swaptionvolconstantspread.hpp.

91{ return cube_->maxStrike(); }

◆ maxSwapTenor()

const Period & maxSwapTenor ( ) const
override

Definition at line 95 of file swaptionvolconstantspread.hpp.

95{ return atm_->maxSwapTenor(); }

◆ volatilityType()

VolatilityType volatilityType ( ) const
override

Definition at line 96 of file swaptionvolconstantspread.hpp.

96{ return atm_->volatilityType(); }

◆ deepUpdate()

void deepUpdate ( )
override

Definition at line 45 of file swaptionvolconstantspread.cpp.

45 {
46 atm_->update();
47 cube_->update();
48 update();
49}

◆ atmVol()

const Handle< SwaptionVolatilityStructure > & atmVol ( )

Definition at line 102 of file swaptionvolconstantspread.hpp.

102{ return atm_; }

◆ cube()

const Handle< SwaptionVolatilityStructure > & cube ( )

Definition at line 103 of file swaptionvolconstantspread.hpp.

103{ return cube_; }

◆ smileSectionImpl()

QuantLib::ext::shared_ptr< SmileSection > smileSectionImpl ( Time  optionTime,
Time  swapLength 
) const
overrideprotected

Definition at line 32 of file swaptionvolconstantspread.cpp.

33 {
34 return QuantLib::ext::make_shared<ConstantSpreadSmileSection>(atm_, cube_, optionTime, swapLength);
35}
+ Here is the caller graph for this function:

◆ volatilityImpl()

Volatility volatilityImpl ( Time  optionTime,
Time  swapLength,
Rate  strike 
) const
overrideprotected

Definition at line 37 of file swaptionvolconstantspread.cpp.

37 {
38 if (strike == Null<Real>())
39 return atm_->volatility(optionTime, swapLength, 0.0);
40 else {
41 return smileSectionImpl(optionTime, swapLength)->volatility(strike);
42 }
43}
QuantLib::ext::shared_ptr< SmileSection > smileSectionImpl(Time optionTime, Time swapLength) const override
+ Here is the call graph for this function:

Member Data Documentation

◆ atm_

Handle<SwaptionVolatilityStructure> atm_
private

Definition at line 111 of file swaptionvolconstantspread.hpp.

◆ cube_

Handle<SwaptionVolatilityStructure> cube_
private

Definition at line 111 of file swaptionvolconstantspread.hpp.