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

#include <qle/termstructures/proxyoptionletvolatility.hpp>

+ Inheritance diagram for ProxyOptionletVolatility:
+ Collaboration diagram for ProxyOptionletVolatility:

Public Member Functions

 ProxyOptionletVolatility (const QuantLib::Handle< OptionletVolatilityStructure > &baseVol, const QuantLib::ext::shared_ptr< QuantLib::IborIndex > &baseIndex, const QuantLib::ext::shared_ptr< QuantLib::IborIndex > &targetIndex, const QuantLib::Period &baseRateComputationPeriod=0 *QuantLib::Days, const QuantLib::Period &targetRateComputationPeriod=0 *QuantLib::Days)
 
QuantLib::Rate minStrike () const override
 
QuantLib::Rate maxStrike () const override
 
QuantLib::Date maxDate () const override
 
const QuantLib::Date & referenceDate () const override
 
VolatilityType volatilityType () const override
 
Real displacement () const override
 
Calendar calendar () const override
 

Private Member Functions

QuantLib::ext::shared_ptr< QuantLib::SmileSection > smileSectionImpl (const QuantLib::Date &optionDate) const override
 
QuantLib::ext::shared_ptr< QuantLib::SmileSection > smileSectionImpl (QuantLib::Time optionTime) const override
 
QuantLib::Volatility volatilityImpl (QuantLib::Time optionTime, QuantLib::Rate strike) const override
 

Private Attributes

QuantLib::Handle< QuantLib::OptionletVolatilityStructure > baseVol_
 
QuantLib::ext::shared_ptr< QuantLib::IborIndex > baseIndex_
 
QuantLib::ext::shared_ptr< QuantLib::IborIndex > targetIndex_
 
QuantLib::Period baseRateComputationPeriod_
 
QuantLib::Period targetRateComputationPeriod_
 

Detailed Description

Definition at line 30 of file proxyoptionletvolatility.hpp.

Constructor & Destructor Documentation

◆ ProxyOptionletVolatility()

ProxyOptionletVolatility ( const QuantLib::Handle< OptionletVolatilityStructure > &  baseVol,
const QuantLib::ext::shared_ptr< QuantLib::IborIndex > &  baseIndex,
const QuantLib::ext::shared_ptr< QuantLib::IborIndex > &  targetIndex,
const QuantLib::Period &  baseRateComputationPeriod = 0 * QuantLib::Days,
const QuantLib::Period &  targetRateComputationPeriod = 0 * QuantLib::Days 
)

Definition at line 46 of file proxyoptionletvolatility.cpp.

51 : OptionletVolatilityStructure(baseVol->businessDayConvention(), baseVol->dayCounter()), baseVol_(baseVol),
52 baseIndex_(baseIndex), targetIndex_(targetIndex), baseRateComputationPeriod_(baseRateComputationPeriod),
53 targetRateComputationPeriod_(targetRateComputationPeriod) {
54
55 QL_REQUIRE(baseIndex != nullptr, "ProxyOptionletVolatility: no base index given.");
56 QL_REQUIRE(targetIndex != nullptr, "ProxyOptionletVolatility: no target index given.");
57 QL_REQUIRE((!isOis(targetIndex_) && !isBMA(targetIndex)) || targetRateComputationPeriod != 0 * Days,
58 "ProxyOptionletVolatility: target index is OIS or BMA/SIFMA ("
59 << targetIndex->name() << "), so targetRateComputationPeriod must be given and != 0D.");
60 QL_REQUIRE((!isOis(baseIndex_) && !isBMA(baseIndex_)) || baseRateComputationPeriod != 0 * Days,
61 "ProxyOptionletVolatility: base index is OIS or BMA/SIFMA ("
62 << baseIndex->name() << "), so baseRateComputationPeriod must be given and != 0D.");
63 registerWith(baseVol_);
64 registerWith(baseIndex_);
65 registerWith(targetIndex_);
66 enableExtrapolation(baseVol->allowsExtrapolation());
67}
QuantLib::ext::shared_ptr< QuantLib::IborIndex > baseIndex_
QuantLib::Handle< QuantLib::OptionletVolatilityStructure > baseVol_
QuantLib::ext::shared_ptr< QuantLib::IborIndex > targetIndex_

Member Function Documentation

◆ minStrike()

QuantLib::Rate minStrike ( ) const
override

Definition at line 38 of file proxyoptionletvolatility.hpp.

38{ return baseVol_->minStrike(); }

◆ maxStrike()

QuantLib::Rate maxStrike ( ) const
override

Definition at line 39 of file proxyoptionletvolatility.hpp.

39{ return baseVol_->maxStrike(); }

◆ maxDate()

QuantLib::Date maxDate ( ) const
override

Definition at line 40 of file proxyoptionletvolatility.hpp.

40{ return baseVol_->maxDate(); }

◆ referenceDate()

const QuantLib::Date & referenceDate ( ) const
override

Definition at line 41 of file proxyoptionletvolatility.hpp.

41{ return baseVol_->referenceDate(); }
+ Here is the caller graph for this function:

◆ volatilityType()

VolatilityType volatilityType ( ) const
override

Definition at line 42 of file proxyoptionletvolatility.hpp.

42{ return baseVol_->volatilityType(); }

◆ displacement()

Real displacement ( ) const
override

Definition at line 43 of file proxyoptionletvolatility.hpp.

43{ return baseVol_->displacement(); }

◆ calendar()

Calendar calendar ( ) const
override

Definition at line 44 of file proxyoptionletvolatility.hpp.

44{ return baseVol_->calendar(); }

◆ smileSectionImpl() [1/2]

QuantLib::ext::shared_ptr< QuantLib::SmileSection > smileSectionImpl ( const QuantLib::Date &  optionDate) const
overrideprivate
+ Here is the caller graph for this function:

◆ smileSectionImpl() [2/2]

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

Definition at line 69 of file proxyoptionletvolatility.cpp.

69 {
70 // imply a fixing date from the optionTime
71 Date fixingDate = lowerDate(optionTime, referenceDate(), dayCounter());
72 return smileSectionImpl(fixingDate);
73}
QuantLib::ext::shared_ptr< QuantLib::SmileSection > smileSectionImpl(const QuantLib::Date &optionDate) const override
const QuantLib::Date & referenceDate() const override
QuantLib::Date fixingDate(const QuantLib::Date &d, const QuantLib::Period obsLag, const QuantLib::Frequency freq, bool interpolated)
Definition: inflation.cpp:183
QuantLib::Date lowerDate(const Real t, const QuantLib::Date &refDate, const QuantLib::DayCounter &dc)
Definition: time.cpp:66
+ Here is the call graph for this function:

◆ volatilityImpl()

Volatility volatilityImpl ( QuantLib::Time  optionTime,
QuantLib::Rate  strike 
) const
overrideprivate

Definition at line 108 of file proxyoptionletvolatility.cpp.

108 {
109 return smileSection(optionTime)->volatility(strike);
110}

Member Data Documentation

◆ baseVol_

QuantLib::Handle<QuantLib::OptionletVolatilityStructure> baseVol_
private

Definition at line 51 of file proxyoptionletvolatility.hpp.

◆ baseIndex_

QuantLib::ext::shared_ptr<QuantLib::IborIndex> baseIndex_
private

Definition at line 52 of file proxyoptionletvolatility.hpp.

◆ targetIndex_

QuantLib::ext::shared_ptr<QuantLib::IborIndex> targetIndex_
private

Definition at line 53 of file proxyoptionletvolatility.hpp.

◆ baseRateComputationPeriod_

QuantLib::Period baseRateComputationPeriod_
private

Definition at line 54 of file proxyoptionletvolatility.hpp.

◆ targetRateComputationPeriod_

QuantLib::Period targetRateComputationPeriod_
private

Definition at line 55 of file proxyoptionletvolatility.hpp.