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

calibration helper for interest-rate swaptions More...

#include <ql/models/shortrate/calibrationhelpers/swaptionhelper.hpp>

Inheritance diagram for SwaptionHelper:

Public Member Functions

 SwaptionHelper (const Period &maturity, const Period &length, const Handle< Quote > &volatility, ext::shared_ptr< IborIndex > index, const Period &fixedLegTenor, DayCounter fixedLegDayCounter, DayCounter floatingLegDayCounter, Handle< YieldTermStructure > termStructure, CalibrationErrorType errorType=RelativePriceError, Real strike=Null< Real >(), Real nominal=1.0, VolatilityType type=ShiftedLognormal, Real shift=0.0, Natural settlementDays=Null< Size >(), RateAveraging::Type averagingMethod=RateAveraging::Compound)
 SwaptionHelper (const Date &exerciseDate, const Period &length, const Handle< Quote > &volatility, ext::shared_ptr< IborIndex > index, const Period &fixedLegTenor, DayCounter fixedLegDayCounter, DayCounter floatingLegDayCounter, Handle< YieldTermStructure > termStructure, CalibrationErrorType errorType=RelativePriceError, Real strike=Null< Real >(), Real nominal=1.0, VolatilityType type=ShiftedLognormal, Real shift=0.0, Natural settlementDays=Null< Size >(), RateAveraging::Type averagingMethod=RateAveraging::Compound)
 SwaptionHelper (const Date &exerciseDate, const Date &endDate, const Handle< Quote > &volatility, ext::shared_ptr< IborIndex > index, const Period &fixedLegTenor, DayCounter fixedLegDayCounter, DayCounter floatingLegDayCounter, Handle< YieldTermStructure > termStructure, CalibrationErrorType errorType=RelativePriceError, Real strike=Null< Real >(), Real nominal=1.0, VolatilityType type=ShiftedLognormal, Real shift=0.0, Natural settlementDays=Null< Size >(), RateAveraging::Type averagingMethod=RateAveraging::Compound)
void addTimesTo (std::list< Time > &times) const override
Real modelValue () const override
 returns the price of the instrument according to the model
Real blackPrice (Volatility volatility) const override
 Black or Bachelier price given a volatility.
const ext::shared_ptr< FixedVsFloatingSwap > & underlying () const
ext::shared_ptr< Swaptionswaption () const
Public Member Functions inherited from BlackCalibrationHelper
 BlackCalibrationHelper (Handle< Quote > volatility, CalibrationErrorType calibrationErrorType=RelativePriceError, const VolatilityType type=ShiftedLognormal, const Real shift=0.0)
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)
Real calibrationError () override
 returns the error resulting from the model valuation
Volatility impliedVolatility (Real targetValue, Real accuracy, Size maxEvaluations, Volatility minVol, Volatility maxVol) const
 Black volatility implied by the model.
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 ()

Additional Inherited Members

Public Types inherited from BlackCalibrationHelper
enum  CalibrationErrorType { RelativePriceError , PriceError , ImpliedVolError }
Public Types inherited from Observer
typedef set_type::iterator iterator
virtual void calculate () const
Protected Attributes inherited from BlackCalibrationHelper
Real marketValue_
Handle< Quotevolatility_
ext::shared_ptr< PricingEngineengine_
const VolatilityType volatilityType_
const Real shift_
bool calculated_ = false
bool frozen_ = false
bool alwaysForward_

Detailed Description

calibration helper for interest-rate swaptions

Warning
passing an overnight index to the constructor will result in an overnight-indexed swap being built, but model-based engines will treat it as a vanilla swap. This is at best a decent proxy, at worst simply wrong. Use with caution.

Member Function Documentation

◆ addTimesTo()

void addTimesTo ( std::list< Time > & times) const
overridevirtual

◆ modelValue()

Real modelValue ( ) const
overridevirtual

returns the price of the instrument according to the model

Implements BlackCalibrationHelper.

◆ blackPrice()

Real blackPrice ( Volatility volatility) const
overridevirtual

Black or Bachelier price given a volatility.

Implements BlackCalibrationHelper.