QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
liquid Black76 market instrument used during calibration More...
#include <calibrationhelper.hpp>
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< Quote > | volatility () const |
returns the volatility Handle More... | |
VolatilityType | volatilityType () const |
returns the volatility type More... | |
Real | marketValue () const |
returns the actual price of the instrument (from volatility) More... | |
virtual Real | modelValue () const =0 |
returns the price of the instrument according to the model More... | |
Real | calibrationError () override |
returns the error resulting from the model valuation More... | |
virtual void | addTimesTo (std::list< Time > ×) const =0 |
Volatility | impliedVolatility (Real targetValue, Real accuracy, Size maxEvaluations, Volatility minVol, Volatility maxVol) const |
Black volatility implied by the model. More... | |
virtual Real | blackPrice (Volatility volatility) const =0 |
Black or Bachelier price given a volatility. More... | |
void | setPricingEngine (const ext::shared_ptr< PricingEngine > &engine) |
Public Member Functions inherited from LazyObject | |
LazyObject () | |
~LazyObject () override=default | |
void | update () override |
bool | isCalculated () const |
void | forwardFirstNotificationOnly () |
void | alwaysForwardNotifications () |
void | recalculate () |
void | freeze () |
void | unfreeze () |
Public Member Functions inherited from Observable | |
Observable () | |
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 () |
Public Member Functions inherited from CalibrationHelper | |
virtual | ~CalibrationHelper ()=default |
virtual Real | calibrationError ()=0 |
returns the error resulting from the model valuation More... | |
Protected Attributes | |
Real | marketValue_ |
Handle< Quote > | volatility_ |
ext::shared_ptr< PricingEngine > | engine_ |
const VolatilityType | volatilityType_ |
const Real | shift_ |
Protected Attributes inherited from LazyObject | |
bool | calculated_ = false |
bool | frozen_ = false |
bool | alwaysForward_ |
Private Attributes | |
const CalibrationErrorType | calibrationErrorType_ |
Additional Inherited Members | |
Protected Member Functions inherited from LazyObject | |
virtual void | calculate () const |
liquid Black76 market instrument used during calibration
Definition at line 48 of file calibrationhelper.hpp.
enum CalibrationErrorType |
Enumerator | |
---|---|
RelativePriceError | |
PriceError | |
ImpliedVolError |
Definition at line 50 of file calibrationhelper.hpp.
BlackCalibrationHelper | ( | Handle< Quote > | volatility, |
CalibrationErrorType | calibrationErrorType = RelativePriceError , |
||
const VolatilityType | type = ShiftedLognormal , |
||
const Real | shift = 0.0 |
||
) |
|
overridevirtual |
This method must implement any calculations which must be (re)done in order to calculate the desired results.
Implements LazyObject.
Reimplemented in HestonModelHelper, CapHelper, and SwaptionHelper.
Definition at line 62 of file calibrationhelper.hpp.
returns the volatility Handle
Definition at line 67 of file calibrationhelper.hpp.
VolatilityType volatilityType | ( | ) | const |
returns the volatility type
Definition at line 70 of file calibrationhelper.hpp.
Real marketValue | ( | ) | const |
returns the actual price of the instrument (from volatility)
Definition at line 73 of file calibrationhelper.hpp.
|
pure virtual |
returns the price of the instrument according to the model
Implemented in HestonModelHelper, CapHelper, and SwaptionHelper.
|
overridevirtual |
returns the error resulting from the model valuation
Implements CalibrationHelper.
Definition at line 52 of file calibrationhelper.cpp.
|
pure virtual |
Implemented in HestonModelHelper, CapHelper, and SwaptionHelper.
Volatility impliedVolatility | ( | Real | targetValue, |
Real | accuracy, | ||
Size | maxEvaluations, | ||
Volatility | minVol, | ||
Volatility | maxVol | ||
) | const |
Black volatility implied by the model.
Definition at line 40 of file calibrationhelper.cpp.
|
pure virtual |
Black or Bachelier price given a volatility.
Implemented in HestonModelHelper, CapHelper, and SwaptionHelper.
void setPricingEngine | ( | const ext::shared_ptr< PricingEngine > & | engine | ) |
Definition at line 93 of file calibrationhelper.hpp.
|
mutableprotected |
Definition at line 98 of file calibrationhelper.hpp.
Definition at line 99 of file calibrationhelper.hpp.
|
protected |
Definition at line 100 of file calibrationhelper.hpp.
|
protected |
Definition at line 101 of file calibrationhelper.hpp.
|
protected |
Definition at line 102 of file calibrationhelper.hpp.
|
private |
Definition at line 106 of file calibrationhelper.hpp.