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

Converts OptionletVolatilityStructure with fixed reference date into a floating reference date term structure. More...

#include <qle/termstructures/dynamicoptionletvolatilitystructure.hpp>

+ Inheritance diagram for DynamicOptionletVolatilityStructure:
+ Collaboration diagram for DynamicOptionletVolatilityStructure:

Public Member Functions

 DynamicOptionletVolatilityStructure (const QuantLib::ext::shared_ptr< OptionletVolatilityStructure > &source, Natural settlementDays, const Calendar &calendar, ReactionToTimeDecay decayMode=ConstantVariance)
 

Protected Member Functions

OptionletVolatilityStructure interface
QuantLib::ext::shared_ptr< SmileSection > smileSectionImpl (Time optionTime) const override
 
Volatility volatilityImpl (Time optionTime, Rate strike) const override
 
VolatilityTermStructure interface
Rate minStrike () const override
 
Rate maxStrike () const override
 
Date maxDate () const override
 

Observer interface

const QuantLib::ext::shared_ptr< OptionletVolatilityStructure > source_
 
ReactionToTimeDecay decayMode_
 
const Date originalReferenceDate_
 
const VolatilityType volatilityType_
 
const Real displacement_
 
void update () override
 
VolatilityType volatilityType () const override
 Override the default implementations in OptionletVolatilityStructure. More...
 
Real displacement () const override
 

Detailed Description

Converts OptionletVolatilityStructure with fixed reference date into a floating reference date term structure.

Different ways of reacting to time decay can be specified.

Warning:
No checks are performed that the supplied OptionletVolatilityStructure has a fixed reference date
\ingroup termstructures

Definition at line 43 of file dynamicoptionletvolatilitystructure.hpp.

Constructor & Destructor Documentation

◆ DynamicOptionletVolatilityStructure()

DynamicOptionletVolatilityStructure ( const QuantLib::ext::shared_ptr< OptionletVolatilityStructure > &  source,
Natural  settlementDays,
const Calendar &  calendar,
ReactionToTimeDecay  decayMode = ConstantVariance 
)

Definition at line 22 of file dynamicoptionletvolatilitystructure.cpp.

25 : OptionletVolatilityStructure(settlementDays, calendar, source->businessDayConvention(), source->dayCounter()),
26 source_(source), decayMode_(decayMode), originalReferenceDate_(source->referenceDate()),
27 volatilityType_(source->volatilityType()), displacement_(source->displacement()) {
29 "ForwardVariance not yet supported for DynamicOptionletVolatilityStructure");
30 enableExtrapolation(source->allowsExtrapolation());
31}
const QuantLib::ext::shared_ptr< OptionletVolatilityStructure > source_
@ ForwardForwardVariance

Member Function Documentation

◆ smileSectionImpl()

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

Definition at line 53 of file dynamicoptionletvolatilitystructure.cpp.

53 {
54 return source_->smileSection(optionTime);
55}

◆ volatilityImpl()

Volatility volatilityImpl ( Time  optionTime,
Rate  strike 
) const
overrideprotected

Definition at line 57 of file dynamicoptionletvolatilitystructure.cpp.

57 {
58 return source_->volatility(optionTime, strike);
59 // tentative ForwardForwardVariance implementation:
60 // if (decayMode_ == ForwardForwardVariance) {
61 // Real timeToRef = source_->timeFromReference(referenceDate());
62 // Real varToRef = source_->blackVariance(timeToRef, strike);
63 // Real varToOptTime = source_->blackVariance(timeToRef + optionTime, strike);
64 // return std::sqrt((varToOptTime - varToRef) / optionTime);
65 // }
66}

◆ minStrike()

Rate minStrike ( ) const
overrideprotected

Definition at line 33 of file dynamicoptionletvolatilitystructure.cpp.

33{ return source_->minStrike(); }

◆ maxStrike()

Rate maxStrike ( ) const
overrideprotected

Definition at line 35 of file dynamicoptionletvolatilitystructure.cpp.

35{ return source_->maxStrike(); }

◆ maxDate()

Date maxDate ( ) const
overrideprotected

Definition at line 37 of file dynamicoptionletvolatilitystructure.cpp.

37 {
39 return source_->maxDate();
40 }
41
43 return Date(std::min(Date::maxDate().serialNumber(), referenceDate().serialNumber() -
44 originalReferenceDate_.serialNumber() +
45 source_->maxDate().serialNumber()));
46 }
47
48 QL_FAIL("unexpected decay mode (" << decayMode_ << ")");
49}
@ ConstantVariance

◆ update()

void update ( )
overrideprotected

Definition at line 51 of file dynamicoptionletvolatilitystructure.cpp.

51{ TermStructure::update(); }

◆ volatilityType()

VolatilityType volatilityType ( ) const
overrideprotected

Override the default implementations in OptionletVolatilityStructure.

Definition at line 84 of file dynamicoptionletvolatilitystructure.hpp.

84{ return volatilityType_; }

◆ displacement()

Real displacement ( ) const
overrideprotected

Definition at line 86 of file dynamicoptionletvolatilitystructure.hpp.

86{ return displacement_; }

Member Data Documentation

◆ source_

const QuantLib::ext::shared_ptr<OptionletVolatilityStructure> source_
private

Definition at line 77 of file dynamicoptionletvolatilitystructure.hpp.

◆ decayMode_

ReactionToTimeDecay decayMode_
private

Definition at line 78 of file dynamicoptionletvolatilitystructure.hpp.

◆ originalReferenceDate_

const Date originalReferenceDate_
private

Definition at line 79 of file dynamicoptionletvolatilitystructure.hpp.

◆ volatilityType_

const VolatilityType volatilityType_
private

Definition at line 80 of file dynamicoptionletvolatilitystructure.hpp.

◆ displacement_

const Real displacement_
private

Definition at line 81 of file dynamicoptionletvolatilitystructure.hpp.