Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
IrLgmData Class Reference

INF Model Parameters. More...

#include <ored/model/irlgmdata.hpp>

+ Inheritance diagram for IrLgmData:
+ Collaboration diagram for IrLgmData:

Public Member Functions

 IrLgmData ()
 Default constructor. More...
 
 IrLgmData (std::string qualifier, CalibrationType calibrationType, ReversionType revType, VolatilityType volType, bool calibrateH, ParamType hType, std::vector< Time > hTimes, std::vector< Real > hValues, bool calibrateA, ParamType aType, std::vector< Time > aTimes, std::vector< Real > aValues, Real shiftHorizon=0.0, Real scaling=1.0, std::vector< std::string > optionExpiries=std::vector< std::string >(), std::vector< std::string > optionTerms=std::vector< std::string >(), std::vector< std::string > optionStrikes=std::vector< std::string >())
 Detailed constructor. More...
 
Serialisation
void fromXML (XMLNode *node) override
 
XMLNodetoXML (XMLDocument &doc) const override
 
void clear () override
 Clear list of calibration instruments. More...
 
void reset () override
 Reset member variables to defaults. More...
 
- Public Member Functions inherited from LgmData
 LgmData ()
 Default constructor. More...
 
 LgmData (std::string qualifier, CalibrationType calibrationType, ReversionType revType, VolatilityType volType, bool calibrateH, ParamType hType, std::vector< Time > hTimes, std::vector< Real > hValues, bool calibrateA, ParamType aType, std::vector< Time > aTimes, std::vector< Real > aValues, Real shiftHorizon=0.0, Real scaling=1.0, std::vector< std::string > optionExpiries=std::vector< std::string >(), std::vector< std::string > optionTerms=std::vector< std::string >(), std::vector< std::string > optionStrikes=std::vector< std::string >(), const QuantExt::AnalyticLgmSwaptionEngine::FloatSpreadMapping inputFloatSpreadMapping=QuantExt::AnalyticLgmSwaptionEngine::proRata)
 Detailed constructor. More...
 
void clear () override
 Clear list of calibration instruments. More...
 
void reset () override
 Reset member variables to defaults. More...
 
ReversionTypereversionType ()
 
VolatilityTypevolatilityType ()
 
boolcalibrateH ()
 
ParamTypehParamType ()
 
std::vector< Time > & hTimes ()
 
std::vector< Real > & hValues ()
 
boolcalibrateA ()
 
ParamTypeaParamType ()
 
std::vector< Time > & aTimes ()
 
std::vector< Real > & aValues ()
 
Real & shiftHorizon ()
 
Real & scaling ()
 
QuantExt::AnalyticLgmSwaptionEngine::FloatSpreadMappingfloatSpreadMapping ()
 
std::vector< std::string > & optionExpiries () const
 
std::vector< std::string > & optionTerms () const
 
std::vector< std::string > & optionStrikes () const
 
ReversionParameter reversionParameter () const
 
VolatilityParameter volatilityParameter () const
 
bool operator== (const LgmData &rhs)
 
bool operator!= (const LgmData &rhs)
 
- Public Member Functions inherited from IrModelData
 IrModelData (const std::string &name)
 minimal constructor More...
 
 IrModelData (const std::string &name, const std::string &qualifier, CalibrationType calibrationType)
 Detailed constructor. More...
 
virtual void clear ()
 Clear list of calibration instruments. More...
 
virtual void reset ()
 Reset member variables to defaults. More...
 
const std::string & name ()
 
std::string & qualifier ()
 
CalibrationTypecalibrationType ()
 
virtual std::string ccy () const
 
- Public Member Functions inherited from XMLSerializable
virtual ~XMLSerializable ()
 
virtual void fromXML (XMLNode *node)=0
 
virtual XMLNodetoXML (XMLDocument &doc) const =0
 
void fromFile (const std::string &filename)
 
void toFile (const std::string &filename) const
 
void fromXMLString (const std::string &xml)
 Parse from XML string. More...
 
std::string toXMLString () const
 Parse from XML string. More...
 

Additional Inherited Members

- Public Types inherited from LgmData
enum class  ReversionType { HullWhite , Hagan }
 Supported mean reversion types. More...
 
enum class  VolatilityType { HullWhite , Hagan }
 Supported volatility types. More...
 
- Protected Attributes inherited from IrModelData
std::string name_
 
std::string qualifier_
 
CalibrationType calibrationType_
 

Detailed Description

INF Model Parameters.

Specification for a IR model component in the Cross Asset LGM (i.e. lognormal Inflation with stochastic IR/FX differential). The specification applies to the volatility component (sigma) of the IR model only.

Definition at line 51 of file irlgmdata.hpp.

Constructor & Destructor Documentation

◆ IrLgmData() [1/2]

IrLgmData ( )

Default constructor.

Definition at line 54 of file irlgmdata.hpp.

54{}

◆ IrLgmData() [2/2]

IrLgmData ( std::string  qualifier,
CalibrationType  calibrationType,
ReversionType  revType,
VolatilityType  volType,
bool  calibrateH,
ParamType  hType,
std::vector< Time >  hTimes,
std::vector< Real >  hValues,
bool  calibrateA,
ParamType  aType,
std::vector< Time >  aTimes,
std::vector< Real >  aValues,
Real  shiftHorizon = 0.0,
Real  scaling = 1.0,
std::vector< std::string >  optionExpiries = std::vector<std::string>(),
std::vector< std::string >  optionTerms = std::vector<std::string>(),
std::vector< std::string >  optionStrikes = std::vector<std::string>() 
)

Detailed constructor.

Definition at line 57 of file irlgmdata.hpp.

63 : LgmData(qualifier, calibrationType, revType, volType, calibrateH, hType, hTimes, hValues, calibrateA, aType,
CalibrationType & calibrationType()
std::string & qualifier()
std::vector< Time > & hTimes()
Definition: lgmdata.hpp:112
std::vector< std::string > & optionExpiries() const
Definition: lgmdata.hpp:121
std::vector< Time > & aTimes()
Definition: lgmdata.hpp:116
Real & scaling()
Definition: lgmdata.hpp:119
LgmData()
Default constructor.
Definition: lgmdata.hpp:75
std::vector< Real > & hValues()
Definition: lgmdata.hpp:113
std::vector< Real > & aValues()
Definition: lgmdata.hpp:117
std::vector< std::string > & optionTerms() const
Definition: lgmdata.hpp:122
Real & shiftHorizon()
Definition: lgmdata.hpp:118
bool & calibrateH()
Definition: lgmdata.hpp:110
bool & calibrateA()
Definition: lgmdata.hpp:114
std::vector< std::string > & optionStrikes() const
Definition: lgmdata.hpp:123

Member Function Documentation

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Reimplemented from LgmData.

Definition at line 27 of file irlgmdata.cpp.

27 {
29 if(qualifier_.empty()) {
30 std::string ccy = XMLUtils::getAttribute(node, "ccy");
31 if(!ccy.empty()) {
33 WLOG("IrLgmData: attribute ccy is deprecated, use key instead.");
34 }
35 }
36 LOG("LGM with attribute (key) = " << qualifier_);
37
38 // Calibration Swaptions
39
40 if (XMLNode* optionsNode = XMLUtils::getChildNode(node, "CalibrationSwaptions")) {
41 optionExpiries() = XMLUtils::getChildrenValuesAsStrings(optionsNode, "Expiries", false);
42 optionTerms() = XMLUtils::getChildrenValuesAsStrings(optionsNode, "Terms", false);
43 QL_REQUIRE(optionExpiries().size() == optionTerms().size(),
44 "vector size mismatch in swaption expiries/terms for ccy " << qualifier_);
45 optionStrikes() = XMLUtils::getChildrenValuesAsStrings(optionsNode, "Strikes", false);
46 if (optionStrikes().size() > 0) {
47 QL_REQUIRE(optionStrikes().size() == optionExpiries().size(),
48 "vector size mismatch in swaption expiries/strikes for ccy " << qualifier_);
49 } else // Default: ATM
50 optionStrikes().resize(optionExpiries().size(), "ATM");
51
52 for (Size i = 0; i < optionExpiries().size(); i++) {
53 LOG("LGM calibration swaption " << optionExpiries()[i] << " x " << optionTerms()[i] << " "
54 << optionStrikes()[i]);
55 }
56 }
57 LgmData::fromXML(node);
58}
virtual std::string ccy() const
virtual void fromXML(XMLNode *node) override
Definition: lgmdata.cpp:145
static string getAttribute(XMLNode *node, const string &attrName)
Definition: xmlutils.cpp:419
static XMLNode * getChildNode(XMLNode *n, const string &name="")
Definition: xmlutils.cpp:387
static vector< string > getChildrenValuesAsStrings(XMLNode *node, const string &name, bool mandatory=false)
Definition: xmlutils.cpp:342
#define LOG(text)
Logging Macro (Level = Notice)
Definition: log.hpp:552
#define WLOG(text)
Logging Macro (Level = Warning)
Definition: log.hpp:550
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
Size size(const ValueType &v)
Definition: value.cpp:145
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Reimplemented from LgmData.

Definition at line 60 of file irlgmdata.cpp.

60 {
61 XMLNode* node = LgmData::toXML(doc);
62 XMLUtils::addAttribute(doc, node, "key", qualifier_);
63
64 // swaption calibration
65 XMLNode* calibrationSwaptionsNode = XMLUtils::addChild(doc, node, "CalibrationSwaptions");
66 XMLUtils::addGenericChildAsList(doc, calibrationSwaptionsNode, "Expiries", optionExpiries());
67 XMLUtils::addGenericChildAsList(doc, calibrationSwaptionsNode, "Terms", optionTerms());
68 XMLUtils::addGenericChildAsList(doc, calibrationSwaptionsNode, "Strikes", optionStrikes());
69
70 return node;
71}
virtual XMLNode * toXML(XMLDocument &doc) const override
Definition: lgmdata.cpp:207
static void addAttribute(XMLDocument &doc, XMLNode *node, const string &attrName, const string &attrValue)
Definition: xmlutils.cpp:412
static void addGenericChildAsList(XMLDocument &doc, XMLNode *n, const string &name, const vector< T > &values, const string &attrName="", const string &attr="")
Definition: xmlutils.hpp:144
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
+ Here is the call graph for this function:

◆ clear()

void clear ( )
overridevirtual

Clear list of calibration instruments.

Reimplemented from IrModelData.

Definition at line 71 of file irlgmdata.hpp.

71{ LgmData::clear(); }
void clear() override
Clear list of calibration instruments.
Definition: lgmdata.cpp:123
+ Here is the call graph for this function:

◆ reset()

void reset ( )
overridevirtual

Reset member variables to defaults.

Reimplemented from IrModelData.

Definition at line 72 of file irlgmdata.hpp.

72 {
74 }
void reset() override
Reset member variables to defaults.
Definition: lgmdata.cpp:129
+ Here is the call graph for this function: