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

#include <kahalesmilesection.hpp>

+ Inheritance diagram for KahaleSmileSection:
+ Collaboration diagram for KahaleSmileSection:

Classes

struct  aHelper
 
struct  cFunction
 
struct  sHelper
 
struct  sHelper1
 

Public Member Functions

 KahaleSmileSection (const ext::shared_ptr< SmileSection > &source, Real atm=Null< Real >(), bool interpolate=false, bool exponentialExtrapolation=false, bool deleteArbitragePoints=false, const std::vector< Real > &moneynessGrid=std::vector< Real >(), Real gap=1.0E-5, int forcedLeftIndex=-1, int forcedRightIndex=QL_MAX_INTEGER)
 
Real minStrike () const override
 
Real maxStrike () const override
 
Real atmLevel () const override
 
const Date & exerciseDate () const override
 
Time exerciseTime () const override
 
const DayCounter & dayCounter () const override
 
const Date & referenceDate () const override
 
VolatilityType volatilityType () const override
 
Real shift () const override
 
Real leftCoreStrike () const
 
Real rightCoreStrike () const
 
std::pair< Size, Size > coreIndices () const
 
Real optionPrice (Rate strike, Option::Type type=Option::Call, Real discount=1.0) const 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 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

Volatility volatilityImpl (Rate strike) const override
 
- Protected Member Functions inherited from SmileSection
virtual void initializeExerciseTime () const
 
virtual Real varianceImpl (Rate strike) const
 
virtual Volatility volatilityImpl (Rate strike) const =0
 

Private Member Functions

Size index (Rate strike) const
 
void compute ()
 

Private Attributes

ext::shared_ptr< SmileSection > source_
 
std::vector< Real > moneynessGrid_
 
std::vector< Real > k_
 
std::vector< Real > c_
 
Real f_
 
const Real gap_
 
Size leftIndex_
 
Size rightIndex_
 
std::vector< ext::shared_ptr< cFunction > > cFunctions_
 
const bool interpolate_
 
const bool exponentialExtrapolation_
 
int forcedLeftIndex_
 
int forcedRightIndex_
 
ext::shared_ptr< SmileSectionUtils > ssutils_
 

Additional Inherited Members

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

Detailed Description

Definition at line 53 of file kahalesmilesection.hpp.

Constructor & Destructor Documentation

◆ KahaleSmileSection()

KahaleSmileSection ( const ext::shared_ptr< SmileSection > &  source,
Real  atm = Null<Real>(),
bool  interpolate = false,
bool  exponentialExtrapolation = false,
bool  deleteArbitragePoints = false,
const std::vector< Real > &  moneynessGrid = std::vector<Real>(),
Real  gap = 1.0E-5,
int  forcedLeftIndex = -1,
int  forcedRightIndex = QL_MAX_INTEGER 
)

Definition at line 26 of file kahalesmilesection.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ minStrike()

Real minStrike ( ) const
overridevirtual

Implements SmileSection.

Definition at line 140 of file kahalesmilesection.hpp.

+ Here is the call graph for this function:

◆ maxStrike()

Real maxStrike ( ) const
overridevirtual

Implements SmileSection.

Definition at line 141 of file kahalesmilesection.hpp.

◆ atmLevel()

Real atmLevel ( ) const
overridevirtual

Implements SmileSection.

Definition at line 142 of file kahalesmilesection.hpp.

◆ exerciseDate()

const Date & exerciseDate ( ) const
overridevirtual

Reimplemented from SmileSection.

Definition at line 143 of file kahalesmilesection.hpp.

◆ exerciseTime()

Time exerciseTime ( ) const
overridevirtual

Reimplemented from SmileSection.

Definition at line 144 of file kahalesmilesection.hpp.

+ Here is the caller graph for this function:

◆ dayCounter()

const DayCounter & dayCounter ( ) const
overridevirtual

Reimplemented from SmileSection.

Definition at line 145 of file kahalesmilesection.hpp.

◆ referenceDate()

const Date & referenceDate ( ) const
overridevirtual

Reimplemented from SmileSection.

Definition at line 146 of file kahalesmilesection.hpp.

◆ volatilityType()

VolatilityType volatilityType ( ) const
overridevirtual

Reimplemented from SmileSection.

Definition at line 147 of file kahalesmilesection.hpp.

◆ shift()

Real shift ( ) const
overridevirtual

Reimplemented from SmileSection.

Definition at line 148 of file kahalesmilesection.hpp.

+ Here is the caller graph for this function:

◆ leftCoreStrike()

Real leftCoreStrike ( ) const

Definition at line 150 of file kahalesmilesection.hpp.

◆ rightCoreStrike()

Real rightCoreStrike ( ) const

Definition at line 151 of file kahalesmilesection.hpp.

◆ coreIndices()

std::pair< Size, Size > coreIndices ( ) const

Definition at line 153 of file kahalesmilesection.hpp.

◆ optionPrice()

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

Reimplemented from SmileSection.

Definition at line 226 of file kahalesmilesection.cpp.

+ Here is the call graph for this function:

◆ volatilityImpl()

Real volatilityImpl ( Rate  strike) const
overrideprotectedvirtual

Implements SmileSection.

Definition at line 243 of file kahalesmilesection.cpp.

+ Here is the call graph for this function:

◆ index()

Size index ( Rate  strike) const
private

Definition at line 263 of file kahalesmilesection.cpp.

+ Here is the caller graph for this function:

◆ compute()

void compute ( )
private

Definition at line 64 of file kahalesmilesection.cpp.

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

Member Data Documentation

◆ source_

ext::shared_ptr<SmileSection> source_
private

Definition at line 167 of file kahalesmilesection.hpp.

◆ moneynessGrid_

std::vector<Real> moneynessGrid_
private

Definition at line 168 of file kahalesmilesection.hpp.

◆ k_

std::vector<Real> k_
private

Definition at line 168 of file kahalesmilesection.hpp.

◆ c_

std::vector<Real> c_
private

Definition at line 168 of file kahalesmilesection.hpp.

◆ f_

Real f_
private

Definition at line 169 of file kahalesmilesection.hpp.

◆ gap_

const Real gap_
private

Definition at line 170 of file kahalesmilesection.hpp.

◆ leftIndex_

Size leftIndex_
private

Definition at line 171 of file kahalesmilesection.hpp.

◆ rightIndex_

Size rightIndex_
private

Definition at line 171 of file kahalesmilesection.hpp.

◆ cFunctions_

std::vector<ext::shared_ptr<cFunction> > cFunctions_
private

Definition at line 172 of file kahalesmilesection.hpp.

◆ interpolate_

const bool interpolate_
private

Definition at line 173 of file kahalesmilesection.hpp.

◆ exponentialExtrapolation_

const bool exponentialExtrapolation_
private

Definition at line 173 of file kahalesmilesection.hpp.

◆ forcedLeftIndex_

int forcedLeftIndex_
private

Definition at line 174 of file kahalesmilesection.hpp.

◆ forcedRightIndex_

int forcedRightIndex_
private

Definition at line 174 of file kahalesmilesection.hpp.

◆ ssutils_

ext::shared_ptr<SmileSectionUtils> ssutils_
private

Definition at line 175 of file kahalesmilesection.hpp.