QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
SmileSection Class Referenceabstract

interest rate volatility smile section More...

#include <smilesection.hpp>

+ Inheritance diagram for SmileSection:
+ Collaboration diagram for SmileSection:

Public Member Functions

 SmileSection (const Date &d, DayCounter dc=DayCounter(), const Date &referenceDate=Date(), VolatilityType type=ShiftedLognormal, Rate shift=0.0)
 
 SmileSection (Time exerciseTime, DayCounter dc=DayCounter(), VolatilityType type=ShiftedLognormal, Rate shift=0.0)
 
 SmileSection ()=default
 
 ~SmileSection () override=default
 
void update () override
 
virtual Real minStrike () const =0
 
virtual Real maxStrike () const =0
 
Real variance (Rate strike) const
 
Volatility volatility (Rate strike) const
 
virtual Real atmLevel () const =0
 
virtual const Date & exerciseDate () const
 
virtual VolatilityType volatilityType () const
 
virtual Rate shift () const
 
virtual const Date & referenceDate () const
 
virtual Time exerciseTime () const
 
virtual const DayCounter & dayCounter () const
 
virtual Real optionPrice (Rate strike, Option::Type type=Option::Call, Real discount=1.0) const
 
virtual Real digitalOptionPrice (Rate strike, Option::Type type=Option::Call, Real discount=1.0, Real gap=1.0e-5) const
 
virtual Real vega (Rate strike, Real discount=1.0) const
 
virtual Real density (Rate strike, Real discount=1.0, Real gap=1.0E-4) const
 
Volatility volatility (Rate strike, VolatilityType type, Real shift=0.0) const
 
- Public Member Functions inherited from Observable
 Observable ()=default
 
 Observable (const Observable &)
 
Observable & operator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observable & operator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
 Observer (const Observer &)
 
Observer & operator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, bool > registerWith (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 ()
 

Protected Member Functions

virtual void initializeExerciseTime () const
 
virtual Real varianceImpl (Rate strike) const
 
virtual Volatility volatilityImpl (Rate strike) const =0
 

Private Attributes

bool isFloating_
 
Date referenceDate_
 
Date exerciseDate_
 
DayCounter dc_
 
Time exerciseTime_
 
VolatilityType volatilityType_
 
Rate shift_
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 

Detailed Description

interest rate volatility smile section

This abstract class provides volatility smile section interface

Definition at line 38 of file smilesection.hpp.

Constructor & Destructor Documentation

◆ SmileSection() [1/3]

SmileSection ( const Date &  d,
DayCounter  dc = DayCounter(),
const Date &  referenceDate = Date(),
VolatilityType  type = ShiftedLognormal,
Rate  shift = 0.0 
)

Definition at line 46 of file smilesection.cpp.

+ Here is the call graph for this function:

◆ SmileSection() [2/3]

SmileSection ( Time  exerciseTime,
DayCounter  dc = DayCounter(),
VolatilityType  type = ShiftedLognormal,
Rate  shift = 0.0 
)

Definition at line 61 of file smilesection.cpp.

◆ SmileSection() [3/3]

SmileSection ( )
default

◆ ~SmileSection()

~SmileSection ( )
overridedefault

Member Function Documentation

◆ update()

void update ( )
overridevirtual

This method must be implemented in derived classes. An instance of Observer does not call this method directly: instead, it will be called by the observables the instance registered with when they need to notify any changes.

Implements Observer.

Reimplemented in SpreadedSmileSection.

Definition at line 31 of file smilesection.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ minStrike()

virtual Real minStrike ( ) const
pure virtual

◆ maxStrike()

virtual Real maxStrike ( ) const
pure virtual

◆ variance()

Real variance ( Rate  strike) const

Definition at line 98 of file smilesection.hpp.

+ Here is the call graph for this function:

◆ volatility() [1/2]

Volatility volatility ( Rate  strike) const

Definition at line 102 of file smilesection.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ atmLevel()

virtual Real atmLevel ( ) const
pure virtual

◆ exerciseDate()

virtual const Date & exerciseDate ( ) const
virtual

Reimplemented in AtmAdjustedSmileSection, AtmSmileSection, KahaleSmileSection, and SpreadedSmileSection.

Definition at line 60 of file smilesection.hpp.

+ Here is the caller graph for this function:

◆ volatilityType()

virtual VolatilityType volatilityType ( ) const
virtual

Reimplemented in AtmAdjustedSmileSection, AtmSmileSection, KahaleSmileSection, and SpreadedSmileSection.

Definition at line 61 of file smilesection.hpp.

+ Here is the caller graph for this function:

◆ shift()

virtual Rate shift ( ) const
virtual

Reimplemented in AtmAdjustedSmileSection, AtmSmileSection, KahaleSmileSection, and SpreadedSmileSection.

Definition at line 64 of file smilesection.hpp.

+ Here is the caller graph for this function:

◆ referenceDate()

const Date & referenceDate ( ) const
virtual

Reimplemented in AtmAdjustedSmileSection, AtmSmileSection, KahaleSmileSection, and SpreadedSmileSection.

Definition at line 106 of file smilesection.hpp.

+ Here is the caller graph for this function:

◆ exerciseTime()

virtual Time exerciseTime ( ) const
virtual

Reimplemented in AtmAdjustedSmileSection, AtmSmileSection, KahaleSmileSection, and SpreadedSmileSection.

Definition at line 66 of file smilesection.hpp.

+ Here is the caller graph for this function:

◆ dayCounter()

virtual const DayCounter & dayCounter ( ) const
virtual

◆ optionPrice()

Real optionPrice ( Rate  strike,
Option::Type  type = Option::Call,
Real  discount = 1.0 
) const
virtual

Reimplemented in NoArbSabrSmileSection, ZabrSmileSection< Evaluation >, AtmAdjustedSmileSection, KahaleSmileSection, and Gaussian1dSmileSection.

Definition at line 72 of file smilesection.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ digitalOptionPrice()

Real digitalOptionPrice ( Rate  strike,
Option::Type  type = Option::Call,
Real  discount = 1.0,
Real  gap = 1.0e-5 
) const
virtual

Reimplemented in NoArbSabrSmileSection, and AtmAdjustedSmileSection.

Definition at line 88 of file smilesection.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vega()

Real vega ( Rate  strike,
Real  discount = 1.0 
) const
virtual

Reimplemented in AtmAdjustedSmileSection.

Definition at line 107 of file smilesection.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ density()

Real density ( Rate  strike,
Real  discount = 1.0,
Real  gap = 1.0E-4 
) const
virtual

Reimplemented in NoArbSabrSmileSection, and AtmAdjustedSmileSection.

Definition at line 99 of file smilesection.cpp.

+ Here is the call graph for this function:

◆ volatility() [2/2]

Real volatility ( Rate  strike,
VolatilityType  type,
Real  shift = 0.0 
) const

Definition at line 119 of file smilesection.cpp.

+ Here is the call graph for this function:

◆ initializeExerciseTime()

void initializeExerciseTime ( ) const
protectedvirtual

Definition at line 38 of file smilesection.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ varianceImpl()

Real varianceImpl ( Rate  strike) const
protectedvirtual

◆ volatilityImpl()

virtual Volatility volatilityImpl ( Rate  strike) const
protectedpure virtual

Member Data Documentation

◆ isFloating_

bool isFloating_
private

Definition at line 86 of file smilesection.hpp.

◆ referenceDate_

Date referenceDate_
mutableprivate

Definition at line 87 of file smilesection.hpp.

◆ exerciseDate_

Date exerciseDate_
private

Definition at line 88 of file smilesection.hpp.

◆ dc_

DayCounter dc_
private

Definition at line 89 of file smilesection.hpp.

◆ exerciseTime_

Time exerciseTime_
mutableprivate

Definition at line 90 of file smilesection.hpp.

◆ volatilityType_

VolatilityType volatilityType_
private

Definition at line 91 of file smilesection.hpp.

◆ shift_

Rate shift_
private

Definition at line 92 of file smilesection.hpp.