33 : calibrate_(calibrate), type_(type), times_(std::move(times)), values_(std::move(values)) {
58 std::transform(
values_.begin(),
values_.end(),
values_.begin(), [&f](
const Real v) { return f * v; });
82 QL_REQUIRE(
values_.size() == 1,
"Parameter type is Constant so expecting a single InitialValue.");
83 QL_REQUIRE(
times_.empty(),
"Parameter type is Constant so expecting an empty time vector.");
85 QL_REQUIRE(
values_.size() ==
times_.size() + 1,
"Parameter type is Piecewise so expecting the size of the " <<
86 "InitialValue vector (" <<
values_.size() <<
") to be one greater than size of time vector (" <<
92 : volatilityType_(
LgmData::VolatilityType::Hagan) {}
95 vector<Time> times, vector<Real> values)
102 : ModelParameter(calibrate, type, times, values) {}
128 : reversionType_(
LgmData::ReversionType::HullWhite) {}
131 vector<Time> times, vector<Real> values)
132 :
ModelParameter(calibrate, type, times, values), reversionType_(reversionType) {}
138 reversionType_(reversionType) {}
Linear Gauss Markov Model Parameters.
ReversionType
Supported mean reversion types.
VolatilityType
Supported volatility types.
const std::vector< QuantLib::Time > & times() const
virtual void check() const
Perform some checks on the parameters.
void setValues(std::vector< Real > values)
std::vector< QuantLib::Real > values_
void append(XMLDocument &doc, XMLNode *node) const
Method used by toXML in derived classes to add the members here to a node.
ModelParameter()
Default constructor.
void fromXML(XMLNode *node) override
void setTimes(std::vector< Real > times)
std::vector< QuantLib::Time > times_
const std::vector< QuantLib::Real > & values() const
void setCalibrate(const bool b)
LgmData::ReversionType reversionType_
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
LgmData::ReversionType reversionType() const
ReversionParameter()
Default constructor.
const boost::optional< LgmData::VolatilityType > & volatilityType() const
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
VolatilityParameter()
Default constructor.
boost::optional< LgmData::VolatilityType > volatilityType_
Small XML Document wrapper class.
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
static void addGenericChildAsList(XMLDocument &doc, XMLNode *n, const string &name, const vector< T > &values, const string &attrName="", const string &attr="")
static void checkNode(XMLNode *n, const string &expectedName)
static void addGenericChild(XMLDocument &doc, XMLNode *n, const char *name, const T &value)
Adds <Name>p1,p2,p3</Name>
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
static bool getChildValueAsBool(XMLNode *node, const string &name, bool mandatory=false, bool defaultValue=true)
static XMLNode * getChildNode(XMLNode *n, const string &name="")
static string getNodeValue(XMLNode *node)
Get a node's value.
static vector< Real > getChildrenValuesAsDoublesCompact(XMLNode *node, const string &name, bool mandatory=false)
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
SafeStack< ValueType > value
class for holding model parameter data
ParamType
Supported calibration parameter type.
ParamType parseParamType(const string &s)
Convert parameter type string into enumerated class value.
VolatilityType volatilityType(CapFloorVolatilityCurveConfig::VolatilityType type)
Imply QuantLib::VolatilityType from CapFloorVolatilityCurveConfig::VolatilityType.
std::string to_string(const LocationInfo &l)
LgmData::ReversionType parseReversionType(const string &s)
Enum parsers.
LgmData::VolatilityType parseVolatilityType(const string &s)
Serializable Credit Default Swap.
string conversion utilities