QuantLib: a free/open-source library for quantitative finance
Reference manual - version 1.40
Loading...
Searching...
No Matches
BlackCalibrationHelper Class Referenceabstract

liquid Black76 market instrument used during calibration More...

#include <ql/models/calibrationhelper.hpp>

Inheritance diagram for BlackCalibrationHelper:

Public Types

enum  CalibrationErrorType { RelativePriceError , PriceError , ImpliedVolError }
Public Types inherited from Observer
typedef set_type::iterator iterator

Public Member Functions

 BlackCalibrationHelper (Handle< Quote > volatility, CalibrationErrorType calibrationErrorType=RelativePriceError, const VolatilityType type=ShiftedLognormal, const Real shift=0.0)
void performCalculations () const override
Handle< Quotevolatility () const
 returns the volatility Handle
VolatilityType volatilityType () const
 returns the volatility type
Real marketValue () const
 returns the actual price of the instrument (from volatility)
virtual Real modelValue () const =0
 returns the price of the instrument according to the model
Real calibrationError () override
 returns the error resulting from the model valuation
virtual void addTimesTo (std::list< Time > &times) const =0
Volatility impliedVolatility (Real targetValue, Real accuracy, Size maxEvaluations, Volatility minVol, Volatility maxVol) const
 Black volatility implied by the model.
virtual Real blackPrice (Volatility volatility) const =0
 Black or Bachelier price given a volatility.
void setPricingEngine (const ext::shared_ptr< PricingEngine > &engine)
Public Member Functions inherited from LazyObject
void update () override
bool isCalculated () const
void forwardFirstNotificationOnly ()
void alwaysForwardNotifications ()
void recalculate ()
void freeze ()
void unfreeze ()
Public Member Functions inherited from Observable
 Observable (const Observable &)
Observableoperator= (const Observable &)
 Observable (Observable &&)=delete
Observableoperator= (Observable &&)=delete
void notifyObservers ()
Public Member Functions inherited from Observer
 Observer (const Observer &)
Observeroperator= (const 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 deepUpdate ()

Protected Attributes

Real marketValue_
Handle< Quotevolatility_
ext::shared_ptr< PricingEngineengine_
const VolatilityType volatilityType_
const Real shift_
bool calculated_ = false
bool frozen_ = false
bool alwaysForward_

Additional Inherited Members

virtual void calculate () const

Detailed Description

liquid Black76 market instrument used during calibration

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.

Reimplemented in HestonModelHelper.

◆ modelValue()

virtual Real modelValue ( ) const
pure virtual

returns the price of the instrument according to the model

Implemented in CapHelper, HestonModelHelper, and SwaptionHelper.

◆ calibrationError()

Real calibrationError ( )
overridevirtual

returns the error resulting from the model valuation

Implements CalibrationHelper.

◆ blackPrice()

virtual Real blackPrice ( Volatility volatility) const
pure virtual

Black or Bachelier price given a volatility.

Implemented in CapHelper, HestonModelHelper, and SwaptionHelper.