Logo
Reference manual - version ored_version
IrModelBuilder Class Referenceabstract

Builder base class for a lgm or hw model. More...

#include <ored/model/irmodelbuilder.hpp>

Inheritance diagram for IrModelBuilder:

Public Types

enum class  FallbackType { NoFallback , FallbackRule1 }

Public Member Functions

 IrModelBuilder (const QuantLib::ext::shared_ptr< ore::data::Market > &market, const QuantLib::ext::shared_ptr< IrModelData > &data, const std::vector< std::string > &optionExpires, const std::vector< std::string > &optionTerms, const std::vector< std::string > &optionStrikes, const std::string &configuration=Market::defaultConfiguration, Real bootstrapTolerance=0.001, const bool continueOnError=false, const std::string &referenceCalibrationGrid="", BlackCalibrationHelper::CalibrationErrorType calibrationErrorType=BlackCalibrationHelper::RelativePriceError, const bool allowChangingFallbacksUnderScenarios=false, const bool allowModelFallbacks=false, const bool requiresCalibration=true, const bool dontCalibrate=false, const std::string &modelLabel="unknown", const std::string &id="unknown")
Real error () const
 Return calibration error.
Inspectors
std::string qualifier ()
std::string ccy ()
QuantLib::ext::shared_ptr< QuantExt::IrModel > model () const
RelinkableHandle< YieldTermStructure > discountCurve ()
QuantLib::ext::shared_ptr< QuantExt::Parametrization > parametrization () const
std::vector< QuantLib::ext::shared_ptr< BlackCalibrationHelper > > swaptionBasket () const

Static Public Attributes

static constexpr Real maxAtmStdDev = 3.0

ModelBuilder interface

QuantLib::ext::shared_ptr< ore::data::Marketmarket_
std::string configuration_
QuantLib::ext::shared_ptr< IrModelDatadata_
std::vector< std::string > optionExpiries_
std::vector< std::string > optionTerms_
std::vector< std::string > optionStrikes_
Real bootstrapTolerance_
bool continueOnError_
std::string referenceCalibrationGrid_
bool setCalibrationInfo_
BlackCalibrationHelper::CalibrationErrorType calibrationErrorType_
bool allowChangingFallbacksUnderScenarios_
bool allowModelFallbacks_ = false
bool requiresCalibration_ = true
bool dontCalibrate_ = false
std::string modelLabel_
std::string id_
std::string currency_
bool parametrizationIsInitialized_ = false
Real error_
QuantLib::ext::shared_ptr< QuantExt::IrModel > model_
Array params_
QuantLib::ext::shared_ptr< QuantExt::Parametrization > parametrization_
std::vector< Size > swaptionIndexInBasket_
std::vector< QuantLib::ext::shared_ptr< BlackCalibrationHelper > > swaptionBasket_
std::vector< Real > swaptionStrike_
std::vector< QuantLib::ext::shared_ptr< SimpleQuote > > swaptionBasketVols_
std::vector< FallbackType > swaptionFallbackType_
std::set< double > swaptionExpiries_
std::set< double > swaptionMaturities_
Date swaptionBasketRefDate_
Handle< QuantLib::SwaptionVolatilityStructure > svts_
Handle< SwapIndex > swapIndex_
Handle< SwapIndex > shortSwapIndex_
RelinkableHandle< YieldTermStructure > modelDiscountCurve_
Handle< YieldTermStructure > calibrationDiscountCurve_
QuantLib::ext::shared_ptr< OptimizationMethod > optimizationMethod_
EndCriteria endCriteria_
std::vector< QuantLib::Real > swaptionVolCache_
bool forceCalibration_ = false
bool suspendCalibration_ = false
QuantLib::ext::shared_ptr< QuantExt::MarketObserver > marketObserver_
void forceRecalculate () override
bool requiresRecalibration () const override
void recalibrate () const override
void newCalcWithoutRecalibration () const override
virtual void initParametrization () const =0
virtual void calibrate () const =0
virtual QuantLib::ext::shared_ptr< PricingEngine > getPricingEngine () const =0
void processException (const std::string &s, const std::exception &e)
void performCalculations () const override
void buildSwaptionBasket (const bool enforceFullRebuild) const
void updateSwaptionBasketVols () const
std::string getBasketDetails (std::vector< QuantExt::SwaptionData > &swaptionData) const
bool volSurfaceChanged (const bool updateCache) const
void getExpiryAndTerm (const Size j, Period &expiryPb, Period &termPb, Date &expiryDb, Date &termDb, Real &termT, bool &expiryDateBased, bool &termDateBased) const
Real getStrike (const Size j) const

Detailed Description

Builder base class for a lgm or hw model.

Constructor & Destructor Documentation

◆ IrModelBuilder()

IrModelBuilder ( const QuantLib::ext::shared_ptr< ore::data::Market > & market,
const QuantLib::ext::shared_ptr< IrModelData > & data,
const std::vector< std::string > & optionExpires,
const std::vector< std::string > & optionTerms,
const std::vector< std::string > & optionStrikes,
const std::string & configuration = Market::defaultConfiguration,
Real bootstrapTolerance = 0.001,
const bool continueOnError = false,
const std::string & referenceCalibrationGrid = "",
BlackCalibrationHelper::CalibrationErrorType calibrationErrorType = BlackCalibrationHelper::RelativePriceError,
const bool allowChangingFallbacksUnderScenarios = false,
const bool allowModelFallbacks = false,
const bool requiresCalibration = true,
const bool dontCalibrate = false,
const std::string & modelLabel = "unknown",
const std::string & id = "unknown" )

The configuration refers to the configuration to read swaption vol and swap index from the market. The discounting curve to price calibrating swaptions is derived from the swap index directly though, i.e. it is not read as a discount curve from the market (except as a fallback in case we do not find the swap index).