QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | List of all members
OptionletStripper1 Class Reference

#include <optionletstripper1.hpp>

+ Inheritance diagram for OptionletStripper1:
+ Collaboration diagram for OptionletStripper1:

Public Member Functions

 OptionletStripper1 (const ext::shared_ptr< CapFloorTermVolSurface > &, const ext::shared_ptr< IborIndex > &index, Rate switchStrikes=Null< Rate >(), Real accuracy=1.0e-6, Natural maxIter=100, const Handle< YieldTermStructure > &discount={}, VolatilityType type=ShiftedLognormal, Real displacement=0.0, bool dontThrow=false)
 
const MatrixcapFloorPrices () const
 
const MatrixcapletVols () const
 
const MatrixcapFloorVolatilities () const
 
const MatrixoptionletPrices () const
 
Rate switchStrike () const
 
- Public Member Functions inherited from OptionletStripper
const std::vector< Rate > & optionletStrikes (Size i) const override
 
const std::vector< Volatility > & optionletVolatilities (Size i) const override
 
const std::vector< Date > & optionletFixingDates () const override
 
const std::vector< Time > & optionletFixingTimes () const override
 
Size optionletMaturities () const override
 
const std::vector< Rate > & atmOptionletRates () const override
 
DayCounter dayCounter () const override
 
Calendar calendar () const override
 
Natural settlementDays () const override
 
BusinessDayConvention businessDayConvention () const override
 
const std::vector< Period > & optionletFixingTenors () const
 
const std::vector< Date > & optionletPaymentDates () const
 
const std::vector< Time > & optionletAccrualPeriods () const
 
ext::shared_ptr< CapFloorTermVolSurfacetermVolSurface () const
 
ext::shared_ptr< IborIndexiborIndex () const
 
Real displacement () const override
 
VolatilityType volatilityType () const override
 
virtual const std::vector< Rate > & optionletStrikes (Size i) const =0
 
virtual const std::vector< Volatility > & optionletVolatilities (Size i) const =0
 
virtual const std::vector< Date > & optionletFixingDates () const =0
 
virtual const std::vector< Time > & optionletFixingTimes () const =0
 
virtual Size optionletMaturities () const =0
 
virtual const std::vector< Rate > & atmOptionletRates () const =0
 
virtual DayCounter dayCounter () const =0
 
virtual Calendar calendar () const =0
 
virtual Natural settlementDays () const =0
 
virtual BusinessDayConvention businessDayConvention () const =0
 
virtual VolatilityType volatilityType () const =0
 
virtual Real displacement () const =0
 
- Public Member Functions inherited from LazyObject
 LazyObject ()
 
 ~LazyObject () override=default
 
void update () override
 
bool isCalculated () const
 
void forwardFirstNotificationOnly ()
 
void alwaysForwardNotifications ()
 
void recalculate ()
 
void freeze ()
 
void unfreeze ()
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 
- 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 ()
 

LazyObject interface

Matrix capFloorPrices_
 
Matrix optionletPrices_
 
Matrix capFloorVols_
 
Matrix optionletStDevs_
 
Matrix capletVols_
 
bool floatingSwitchStrike_
 
Rate switchStrike_
 
Real accuracy_
 
Natural maxIter_
 
bool dontThrow_
 
void performCalculations () const override
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 
- Protected Member Functions inherited from OptionletStripper
 OptionletStripper (const ext::shared_ptr< CapFloorTermVolSurface > &, ext::shared_ptr< IborIndex > iborIndex_, Handle< YieldTermStructure > discount={}, VolatilityType type=ShiftedLognormal, Real displacement=0.0)
 
- Protected Member Functions inherited from LazyObject
virtual void calculate () const
 
- Protected Attributes inherited from OptionletStripper
ext::shared_ptr< CapFloorTermVolSurfacetermVolSurface_
 
ext::shared_ptr< IborIndexiborIndex_
 
Handle< YieldTermStructurediscount_
 
Size nStrikes_
 
Size nOptionletTenors_
 
std::vector< std::vector< Rate > > optionletStrikes_
 
std::vector< std::vector< Volatility > > optionletVolatilities_
 
std::vector< TimeoptionletTimes_
 
std::vector< DateoptionletDates_
 
std::vector< PeriodoptionletTenors_
 
std::vector< RateatmOptionletRate_
 
std::vector< DateoptionletPaymentDates_
 
std::vector< TimeoptionletAccrualPeriods_
 
std::vector< PeriodcapFloorLengths_
 
const VolatilityType volatilityType_
 
const Real displacement_
 
- Protected Attributes inherited from LazyObject
bool calculated_ = false
 
bool frozen_ = false
 
bool alwaysForward_
 

Detailed Description

Helper class to strip optionlet (i.e. caplet/floorlet) volatilities (a.k.a. forward-forward volatilities) from the (cap/floor) term volatilities of a CapFloorTermVolSurface.

Definition at line 44 of file optionletstripper1.hpp.

Constructor & Destructor Documentation

◆ OptionletStripper1()

OptionletStripper1 ( const ext::shared_ptr< CapFloorTermVolSurface > &  termVolSurface,
const ext::shared_ptr< IborIndex > &  index,
Rate  switchStrikes = Null<Rate>(),
Real  accuracy = 1.0e-6,
Natural  maxIter = 100,
const Handle< YieldTermStructure > &  discount = {},
VolatilityType  type = ShiftedLognormal,
Real  displacement = 0.0,
bool  dontThrow = false 
)

Definition at line 37 of file optionletstripper1.cpp.

Member Function Documentation

◆ capFloorPrices()

const Matrix & capFloorPrices ( ) const

Definition at line 184 of file optionletstripper1.cpp.

+ Here is the call graph for this function:

◆ capletVols()

const Matrix & capletVols ( ) const

Definition at line 179 of file optionletstripper1.cpp.

+ Here is the call graph for this function:

◆ capFloorVolatilities()

const Matrix & capFloorVolatilities ( ) const

Definition at line 189 of file optionletstripper1.cpp.

+ Here is the call graph for this function:

◆ optionletPrices()

const Matrix & optionletPrices ( ) const

Definition at line 194 of file optionletstripper1.cpp.

+ Here is the call graph for this function:

◆ switchStrike()

Rate switchStrike ( ) const

Definition at line 199 of file optionletstripper1.cpp.

+ Here is the call graph for this function:

◆ performCalculations()

void performCalculations ( ) const
overridevirtual

This method must implement any calculations which must be (re)done in order to calculate the desired results.

Implements LazyObject.

Definition at line 60 of file optionletstripper1.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ capFloorPrices_

Matrix capFloorPrices_
mutableprivate

Definition at line 68 of file optionletstripper1.hpp.

◆ optionletPrices_

Matrix optionletPrices_
private

Definition at line 68 of file optionletstripper1.hpp.

◆ capFloorVols_

Matrix capFloorVols_
mutableprivate

Definition at line 69 of file optionletstripper1.hpp.

◆ optionletStDevs_

Matrix optionletStDevs_
mutableprivate

Definition at line 70 of file optionletstripper1.hpp.

◆ capletVols_

Matrix capletVols_
private

Definition at line 70 of file optionletstripper1.hpp.

◆ floatingSwitchStrike_

bool floatingSwitchStrike_
private

Definition at line 72 of file optionletstripper1.hpp.

◆ switchStrike_

Rate switchStrike_
mutableprivate

Definition at line 74 of file optionletstripper1.hpp.

◆ accuracy_

Real accuracy_
private

Definition at line 75 of file optionletstripper1.hpp.

◆ maxIter_

Natural maxIter_
private

Definition at line 76 of file optionletstripper1.hpp.

◆ dontThrow_

bool dontThrow_
private

Definition at line 77 of file optionletstripper1.hpp.