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

#include <zabrsmilesection.hpp>

+ Inheritance diagram for ZabrSmileSection< Evaluation >:
+ Collaboration diagram for ZabrSmileSection< Evaluation >:

Public Member Functions

 ZabrSmileSection (Time timeToExpiry, Rate forward, std::vector< Real > zabrParameters, const std::vector< Real > &moneyness=std::vector< Real >(), Size fdRefinement=5)
 
 ZabrSmileSection (const Date &d, Rate forward, std::vector< Real > zabrParameters, const DayCounter &dc=Actual365Fixed(), const std::vector< Real > &moneyness=std::vector< Real >(), Size fdRefinement=5)
 
Real minStrike () const override
 
Real maxStrike () const override
 
Real atmLevel () const override
 
Real optionPrice (Rate strike, Option::Type type=Option::Call, Real discount=1.0) const override
 
ext::shared_ptr< ZabrModelmodel ()
 
- 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 ()
 

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

void init (const std::vector< Real > &moneyness)
 
void init (const std::vector< Real > &moneyness, ZabrShortMaturityLognormal)
 
void init (const std::vector< Real > &moneyness, ZabrShortMaturityNormal)
 
void init (const std::vector< Real > &moneyness, ZabrLocalVolatility)
 
void init (const std::vector< Real > &moneyness, ZabrFullFd)
 
void init2 (ZabrShortMaturityLognormal)
 
void init2 (ZabrShortMaturityNormal)
 
void init2 (ZabrLocalVolatility)
 
void init2 (ZabrFullFd)
 
void init3 (ZabrShortMaturityLognormal)
 
void init3 (ZabrShortMaturityNormal)
 
void init3 (ZabrLocalVolatility)
 
void init3 (ZabrFullFd)
 
Real optionPrice (Rate strike, Option::Type type, Real discount, ZabrShortMaturityLognormal) const
 
Real optionPrice (Rate strike, Option::Type type, Real discount, ZabrShortMaturityNormal) const
 
Real optionPrice (Rate strike, Option::Type type, Real discount, ZabrLocalVolatility) const
 
Real optionPrice (Rate strike, Option::Type type, Real discount, ZabrFullFd) const
 
Volatility volatilityImpl (Rate strike, ZabrShortMaturityLognormal) const
 
Volatility volatilityImpl (Rate strike, ZabrShortMaturityNormal) const
 
Volatility volatilityImpl (Rate strike, ZabrLocalVolatility) const
 
Volatility volatilityImpl (Rate strike, ZabrFullFd) const
 

Private Attributes

ext::shared_ptr< ZabrModelmodel_
 
Evaluation evaluation_
 
Rate forward_
 
std::vector< Realparams_
 
const Size fdRefinement_
 
std::vector< Realstrikes_
 
std::vector< RealcallPrices_
 
ext::shared_ptr< InterpolationcallPriceFct_
 
Real a_
 
Real b_
 

Additional Inherited Members

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

Detailed Description

template<typename Evaluation>
class QuantLib::ZabrSmileSection< Evaluation >

Definition at line 46 of file zabrsmilesection.hpp.

Constructor & Destructor Documentation

◆ ZabrSmileSection() [1/2]

ZabrSmileSection ( Time  timeToExpiry,
Rate  forward,
std::vector< Real zabrParameters,
const std::vector< Real > &  moneyness = std::vector<Real>(),
Size  fdRefinement = 5 
)

Definition at line 116 of file zabrsmilesection.hpp.

+ Here is the call graph for this function:

◆ ZabrSmileSection() [2/2]

ZabrSmileSection ( const Date d,
Rate  forward,
std::vector< Real zabrParameters,
const DayCounter dc = Actual365Fixed(),
const std::vector< Real > &  moneyness = std::vector<Real>(),
Size  fdRefinement = 5 
)

Definition at line 127 of file zabrsmilesection.hpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ minStrike()

Real minStrike ( ) const
overridevirtual

Implements SmileSection.

Definition at line 60 of file zabrsmilesection.hpp.

◆ maxStrike()

Real maxStrike ( ) const
overridevirtual

Implements SmileSection.

Definition at line 61 of file zabrsmilesection.hpp.

◆ atmLevel()

Real atmLevel ( ) const
overridevirtual

Implements SmileSection.

Definition at line 62 of file zabrsmilesection.hpp.

◆ optionPrice() [1/5]

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

Reimplemented from SmileSection.

Definition at line 64 of file zabrsmilesection.hpp.

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

◆ model()

ext::shared_ptr< ZabrModel > model ( )

Definition at line 68 of file zabrsmilesection.hpp.

◆ volatilityImpl() [1/5]

Volatility volatilityImpl ( Rate  strike) const
overrideprotectedvirtual

Implements SmileSection.

Definition at line 71 of file zabrsmilesection.hpp.

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

◆ init() [1/5]

void init ( const std::vector< Real > &  moneyness)
private

Definition at line 76 of file zabrsmilesection.hpp.

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

◆ init() [2/5]

void init ( const std::vector< Real > &  moneyness,
ZabrShortMaturityLognormal   
)
private

Definition at line 139 of file zabrsmilesection.hpp.

◆ init() [3/5]

void init ( const std::vector< Real > &  moneyness,
ZabrShortMaturityNormal   
)
private

Definition at line 148 of file zabrsmilesection.hpp.

◆ init() [4/5]

void init ( const std::vector< Real > &  moneyness,
ZabrLocalVolatility   
)
private

Definition at line 154 of file zabrsmilesection.hpp.

◆ init() [5/5]

void init ( const std::vector< Real > &  moneyness,
ZabrFullFd   
)
private

Definition at line 197 of file zabrsmilesection.hpp.

◆ init2() [1/4]

void init2 ( ZabrShortMaturityLognormal  )
private

Definition at line 203 of file zabrsmilesection.hpp.

+ Here is the caller graph for this function:

◆ init2() [2/4]

void init2 ( ZabrShortMaturityNormal  )
private

Definition at line 206 of file zabrsmilesection.hpp.

◆ init2() [3/4]

void init2 ( ZabrLocalVolatility  )
private

Definition at line 209 of file zabrsmilesection.hpp.

◆ init2() [4/4]

void init2 ( ZabrFullFd  )
private

Definition at line 214 of file zabrsmilesection.hpp.

◆ init3() [1/4]

void init3 ( ZabrShortMaturityLognormal  )
private

Definition at line 223 of file zabrsmilesection.hpp.

+ Here is the caller graph for this function:

◆ init3() [2/4]

void init3 ( ZabrShortMaturityNormal  )
private

Definition at line 226 of file zabrsmilesection.hpp.

◆ init3() [3/4]

void init3 ( ZabrLocalVolatility  )
private

Definition at line 229 of file zabrsmilesection.hpp.

◆ init3() [4/4]

void init3 ( ZabrFullFd  )
private

Definition at line 256 of file zabrsmilesection.hpp.

◆ optionPrice() [2/5]

Real optionPrice ( Rate  strike,
Option::Type  type,
Real  discount,
ZabrShortMaturityLognormal   
) const
private

Definition at line 262 of file zabrsmilesection.hpp.

+ Here is the call graph for this function:

◆ optionPrice() [3/5]

Real optionPrice ( Rate  strike,
Option::Type  type,
Real  discount,
ZabrShortMaturityNormal   
) const
private

Definition at line 269 of file zabrsmilesection.hpp.

+ Here is the call graph for this function:

◆ optionPrice() [4/5]

Real optionPrice ( Rate  strike,
Option::Type  type,
Real  discount,
ZabrLocalVolatility   
) const
private

Definition at line 278 of file zabrsmilesection.hpp.

◆ optionPrice() [5/5]

Real optionPrice ( Rate  strike,
Option::Type  type,
Real  discount,
ZabrFullFd   
) const
private

Definition at line 290 of file zabrsmilesection.hpp.

◆ volatilityImpl() [2/5]

Real volatilityImpl ( Rate  strike,
ZabrShortMaturityLognormal   
) const
private

Definition at line 298 of file zabrsmilesection.hpp.

◆ volatilityImpl() [3/5]

Real volatilityImpl ( Rate  strike,
ZabrShortMaturityNormal   
) const
private

Definition at line 306 of file zabrsmilesection.hpp.

+ Here is the call graph for this function:

◆ volatilityImpl() [4/5]

Real volatilityImpl ( Rate  strike,
ZabrLocalVolatility   
) const
private

Definition at line 325 of file zabrsmilesection.hpp.

◆ volatilityImpl() [5/5]

Real volatilityImpl ( Rate  strike,
ZabrFullFd   
) const
private

Definition at line 331 of file zabrsmilesection.hpp.

Member Data Documentation

◆ model_

ext::shared_ptr<ZabrModel> model_
private

Definition at line 105 of file zabrsmilesection.hpp.

◆ evaluation_

Evaluation evaluation_
private

Definition at line 106 of file zabrsmilesection.hpp.

◆ forward_

Rate forward_
private

Definition at line 107 of file zabrsmilesection.hpp.

◆ params_

std::vector<Real> params_
private

Definition at line 108 of file zabrsmilesection.hpp.

◆ fdRefinement_

const Size fdRefinement_
private

Definition at line 109 of file zabrsmilesection.hpp.

◆ strikes_

std::vector<Real> strikes_
private

Definition at line 110 of file zabrsmilesection.hpp.

◆ callPrices_

std::vector<Real> callPrices_
private

Definition at line 110 of file zabrsmilesection.hpp.

◆ callPriceFct_

ext::shared_ptr<Interpolation> callPriceFct_
private

Definition at line 111 of file zabrsmilesection.hpp.

◆ a_

Real a_
private

Definition at line 112 of file zabrsmilesection.hpp.

◆ b_

Real b_
private

Definition at line 112 of file zabrsmilesection.hpp.