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

#include <ored/model/modelparameter.hpp>

+ Inheritance diagram for VolatilityParameter:
+ Collaboration diagram for VolatilityParameter:

Public Member Functions

 VolatilityParameter ()
 Default constructor. More...
 
 VolatilityParameter (LgmData::VolatilityType volatilityType, bool calibrate, ParamType type, std::vector< QuantLib::Time > times, std::vector< QuantLib::Real > values)
 Constructor for piecewise volatility with an explicit volatility type. More...
 
 VolatilityParameter (LgmData::VolatilityType volatilityType, bool calibrate, QuantLib::Real value)
 Constructor for constant volatility with an explicit volatility type. More...
 
 VolatilityParameter (bool calibrate, ParamType type, std::vector< QuantLib::Real > times, std::vector< QuantLib::Real > values)
 Constructor for piecewise volatility without an explicit volatility type. More...
 
 VolatilityParameter (bool calibrate, QuantLib::Real value)
 Constructor for constant volatility without an explicit volatility type. More...
 
Inspectors
const boost::optional< LgmData::VolatilityType > & volatilityType () const
 
- Public Member Functions inherited from ModelParameter
 ModelParameter ()
 Default constructor. More...
 
 ModelParameter (bool calibrate, ParamType type, std::vector< QuantLib::Time > times, std::vector< QuantLib::Real > values)
 Detailed constructor. More...
 
bool calibrate () const
 
ParamType type () const
 
const std::vector< QuantLib::Time > & times () const
 
const std::vector< QuantLib::Real > & values () const
 
void setTimes (std::vector< Real > times)
 
void setValues (std::vector< Real > values)
 
void mult (const Real f)
 
void setCalibrate (const bool b)
 
- 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...
 

Serialisation

boost::optional< LgmData::VolatilityTypevolatilityType_
 
void fromXML (XMLNode *node) override
 
XMLNodetoXML (XMLDocument &doc) const override
 

Additional Inherited Members

- Protected Member Functions inherited from ModelParameter
void append (XMLDocument &doc, XMLNode *node) const
 Method used by toXML in derived classes to add the members here to a node. More...
 
virtual void check () const
 Perform some checks on the parameters. More...
 

Detailed Description

Volatility model parameter with optional volatility type.

Note
The volatility type is currently an LGM volatility type. We may want to broaden this in future.

Definition at line 90 of file modelparameter.hpp.

Constructor & Destructor Documentation

◆ VolatilityParameter() [1/5]

Default constructor.

Definition at line 91 of file modelparameter.cpp.

@ Hagan
Parametrize volatility as Hagan alpha(t)
boost::optional< LgmData::VolatilityType > volatilityType_

◆ VolatilityParameter() [2/5]

VolatilityParameter ( LgmData::VolatilityType  volatilityType,
bool  calibrate,
ParamType  type,
std::vector< QuantLib::Time >  times,
std::vector< QuantLib::Real >  values 
)

Constructor for piecewise volatility with an explicit volatility type.

◆ VolatilityParameter() [3/5]

VolatilityParameter ( LgmData::VolatilityType  volatilityType,
bool  calibrate,
QuantLib::Real  value 
)

Constructor for constant volatility with an explicit volatility type.

Definition at line 98 of file modelparameter.cpp.

ModelParameter()
Default constructor.
const boost::optional< LgmData::VolatilityType > & volatilityType() const
SafeStack< ValueType > value

◆ VolatilityParameter() [4/5]

VolatilityParameter ( bool  calibrate,
ParamType  type,
std::vector< QuantLib::Real >  times,
std::vector< QuantLib::Real >  values 
)

Constructor for piecewise volatility without an explicit volatility type.

◆ VolatilityParameter() [5/5]

VolatilityParameter ( bool  calibrate,
QuantLib::Real  value 
)

Constructor for constant volatility without an explicit volatility type.

Definition at line 104 of file modelparameter.cpp.

Member Function Documentation

◆ volatilityType()

const boost::optional< LgmData::VolatilityType > & volatilityType ( ) const

Definition at line 107 of file modelparameter.cpp.

107 {
108 return volatilityType_;
109}
+ Here is the caller graph for this function:

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Reimplemented from ModelParameter.

Definition at line 111 of file modelparameter.cpp.

111 {
112 XMLUtils::checkNode(node, "Volatility");
113 if (XMLNode* n = XMLUtils::getChildNode(node, "VolatilityType")) {
115 }
117}
void fromXML(XMLNode *node) override
static void checkNode(XMLNode *n, const string &expectedName)
Definition: xmlutils.cpp:175
static XMLNode * getChildNode(XMLNode *n, const string &name="")
Definition: xmlutils.cpp:387
static string getNodeValue(XMLNode *node)
Get a node's value.
Definition: xmlutils.cpp:489
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
LgmData::VolatilityType parseVolatilityType(const string &s)
Definition: lgmdata.cpp:81
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 119 of file modelparameter.cpp.

119 {
120 XMLNode* node = doc.allocNode("Volatility");
121 if (volatilityType_)
122 XMLUtils::addChild(doc, node, "VolatilityType", to_string(*volatilityType_));
123 ModelParameter::append(doc, node);
124 return node;
125}
void append(XMLDocument &doc, XMLNode *node) const
Method used by toXML in derived classes to add the members here to a node.
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
std::string to_string(const LocationInfo &l)
Definition: ast.cpp:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ volatilityType_

boost::optional<LgmData::VolatilityType> volatilityType_
private

Definition at line 123 of file modelparameter.hpp.