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

#include <interpolatedsmilesection.hpp>

+ Inheritance diagram for InterpolatedSmileSection< Interpolator >:
+ Collaboration diagram for InterpolatedSmileSection< Interpolator >:

Public Member Functions

 InterpolatedSmileSection (Time expiryTime, std::vector< Rate > strikes, const std::vector< Handle< Quote > > &stdDevHandles, Handle< Quote > atmLevel, const Interpolator &interpolator=Interpolator(), const DayCounter &dc=Actual365Fixed(), VolatilityType type=ShiftedLognormal, Real shift=0.0)
 
 InterpolatedSmileSection (Time expiryTime, std::vector< Rate > strikes, const std::vector< Real > &stdDevs, Real atmLevel, const Interpolator &interpolator=Interpolator(), const DayCounter &dc=Actual365Fixed(), VolatilityType type=ShiftedLognormal, Real shift=0.0)
 
 InterpolatedSmileSection (const Date &d, std::vector< Rate > strikes, const std::vector< Handle< Quote > > &stdDevHandles, Handle< Quote > atmLevel, const DayCounter &dc=Actual365Fixed(), const Interpolator &interpolator=Interpolator(), const Date &referenceDate=Date(), VolatilityType type=ShiftedLognormal, Real shift=0.0)
 
 InterpolatedSmileSection (const Date &d, std::vector< Rate > strikes, const std::vector< Real > &stdDevs, Real atmLevel, const DayCounter &dc=Actual365Fixed(), const Interpolator &interpolator=Interpolator(), const Date &referenceDate=Date(), VolatilityType type=ShiftedLognormal, Real shift=0.0)
 
void performCalculations () const override
 
Real varianceImpl (Rate strike) const override
 
Volatility volatilityImpl (Rate strike) const override
 
Real minStrike () const override
 
Real maxStrike () const override
 
Real atmLevel () const override
 
void update () override
 
- Public Member Functions inherited from SmileSection
 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 DateexerciseDate () const
 
virtual VolatilityType volatilityType () const
 
virtual Rate shift () const
 
virtual const DatereferenceDate () const
 
virtual Time exerciseTime () const
 
virtual const DayCounterdayCounter () 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 ()
 
 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 ()
 
- Public Member Functions inherited from LazyObject
 LazyObject ()
 
 ~LazyObject () override=default
 
bool isCalculated () const
 
void forwardFirstNotificationOnly ()
 
void alwaysForwardNotifications ()
 
void recalculate ()
 
void freeze ()
 
void unfreeze ()
 

Private Attributes

Real exerciseTimeSquareRoot_
 
std::vector< Ratestrikes_
 
std::vector< Handle< Quote > > stdDevHandles_
 
Handle< QuoteatmLevel_
 
std::vector< Volatilityvols_
 
Interpolation interpolation_
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 
- Protected Member Functions inherited from SmileSection
virtual void initializeExerciseTime () const
 
virtual Real varianceImpl (Rate strike) const
 
virtual Volatility volatilityImpl (Rate strike) const =0
 
- Protected Member Functions inherited from LazyObject
virtual void calculate () const
 
- Protected Attributes inherited from LazyObject
bool calculated_ = false
 
bool frozen_ = false
 
bool alwaysForward_
 

Detailed Description

template<class Interpolator>
class QuantLib::InterpolatedSmileSection< Interpolator >

Definition at line 40 of file interpolatedsmilesection.hpp.

Constructor & Destructor Documentation

◆ InterpolatedSmileSection() [1/4]

InterpolatedSmileSection ( Time  expiryTime,
std::vector< Rate strikes,
const std::vector< Handle< Quote > > &  stdDevHandles,
Handle< Quote atmLevel,
const Interpolator &  interpolator = Interpolator(),
const DayCounter dc = Actual365Fixed(),
VolatilityType  type = ShiftedLognormal,
Real  shift = 0.0 
)

Definition at line 97 of file interpolatedsmilesection.hpp.

+ Here is the call graph for this function:

◆ InterpolatedSmileSection() [2/4]

InterpolatedSmileSection ( Time  expiryTime,
std::vector< Rate strikes,
const std::vector< Real > &  stdDevs,
Real  atmLevel,
const Interpolator &  interpolator = Interpolator(),
const DayCounter dc = Actual365Fixed(),
VolatilityType  type = ShiftedLognormal,
Real  shift = 0.0 
)

Definition at line 119 of file interpolatedsmilesection.hpp.

+ Here is the call graph for this function:

◆ InterpolatedSmileSection() [3/4]

InterpolatedSmileSection ( const Date d,
std::vector< Rate strikes,
const std::vector< Handle< Quote > > &  stdDevHandles,
Handle< Quote atmLevel,
const DayCounter dc = Actual365Fixed(),
const Interpolator &  interpolator = Interpolator(),
const Date referenceDate = Date(),
VolatilityType  type = ShiftedLognormal,
Real  shift = 0.0 
)

Definition at line 145 of file interpolatedsmilesection.hpp.

+ Here is the call graph for this function:

◆ InterpolatedSmileSection() [4/4]

InterpolatedSmileSection ( const Date d,
std::vector< Rate strikes,
const std::vector< Real > &  stdDevs,
Real  atmLevel,
const DayCounter dc = Actual365Fixed(),
const Interpolator &  interpolator = Interpolator(),
const Date referenceDate = Date(),
VolatilityType  type = ShiftedLognormal,
Real  shift = 0.0 
)

Definition at line 168 of file interpolatedsmilesection.hpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ 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 196 of file interpolatedsmilesection.hpp.

◆ varianceImpl()

Real varianceImpl ( Rate  strike) const
overridevirtual

Reimplemented from SmileSection.

◆ volatilityImpl()

Volatility volatilityImpl ( Rate  strike) const
overridevirtual

Implements SmileSection.

◆ minStrike()

Real minStrike ( ) const
overridevirtual

Implements SmileSection.

Definition at line 81 of file interpolatedsmilesection.hpp.

◆ maxStrike()

Real maxStrike ( ) const
overridevirtual

Implements SmileSection.

Definition at line 82 of file interpolatedsmilesection.hpp.

◆ atmLevel()

Real atmLevel ( ) const
overridevirtual

Implements SmileSection.

Definition at line 83 of file interpolatedsmilesection.hpp.

+ Here is the caller graph for this function:

◆ 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.

Reimplemented from LazyObject.

Member Data Documentation

◆ exerciseTimeSquareRoot_

Real exerciseTimeSquareRoot_
private

Definition at line 87 of file interpolatedsmilesection.hpp.

◆ strikes_

std::vector<Rate> strikes_
private

Definition at line 88 of file interpolatedsmilesection.hpp.

◆ stdDevHandles_

std::vector<Handle<Quote> > stdDevHandles_
private

Definition at line 89 of file interpolatedsmilesection.hpp.

◆ atmLevel_

Handle<Quote> atmLevel_
private

Definition at line 90 of file interpolatedsmilesection.hpp.

◆ vols_

std::vector<Volatility> vols_
mutableprivate

Definition at line 91 of file interpolatedsmilesection.hpp.

◆ interpolation_

Interpolation interpolation_
mutableprivate

Definition at line 92 of file interpolatedsmilesection.hpp.