22using QuantLib::BoundaryConstraint;
23using QuantLib::Constraint;
24using QuantLib::NoConstraint;
37 : rmseTolerance_(rmseTolerance), maxIterations_(maxIterations) {}
50 return QuantLib::ext::make_shared<BoundaryConstraint>(it->second.first, it->second.second);
52 return QuantLib::ext::make_shared<NoConstraint>();
61 return make_pair(Null<Real>(), Null<Real>());
66 QL_REQUIRE(lowerBound < upperBound,
"CalibrationConfiguration: Lower bound (" << lowerBound <<
67 ") must be less than upper bound (" << upperBound <<
").");
69 DLOG(
"Boundary constraint [" << lowerBound <<
"," << upperBound <<
"] added for parameter " <<
name <<
".");
91 if (constraintName !=
"BoundaryConstraint") {
92 DLOG(
"CalibrationConfiguration skipping constraint with name " << constraintName <<
". Only " <<
93 "BoundaryConstraint is currently supported.");
100 add(
name, lowerBound, upperBound);
class for holding calibration configuration details
QuantLib::Real rmseTolerance() const
A final tolerance on the RMSE of the calibration that may be used by various builders.
QuantLib::ext::shared_ptr< QuantLib::Constraint > constraint(const std::string &name) const
std::map< std::string, std::pair< QuantLib::Real, QuantLib::Real > > constraints_
std::pair< QuantLib::Real, QuantLib::Real > boundaries(const std::string &name) const
QuantLib::Real rmseTolerance_
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
void add(const std::string &name, QuantLib::Real lowerBound, QuantLib::Real upperBound)
QuantLib::Size maxIterations() const
QuantLib::Size maxIterations_
CalibrationConfiguration(QuantLib::Real rmseTolerance=0.0001, QuantLib::Size maxIterations=50)
Constructor.
Small XML Document wrapper class.
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
static void addAttribute(XMLDocument &doc, XMLNode *node, const string &attrName, const string &attrValue)
static string getAttribute(XMLNode *node, const string &attrName)
static void checkNode(XMLNode *n, const string &expectedName)
static string getNodeName(XMLNode *n)
Get and set a node's name.
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
static XMLNode * getChildNode(XMLNode *n, const string &name="")
static string getNodeValue(XMLNode *node)
Get a node's value.
static XMLNode * getNextSibling(XMLNode *node, const string &name="")
Get a node's next sibling node.
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
static void appendNode(XMLNode *parent, XMLNode *child)
Real parseReal(const string &s)
Convert text to Real.
Integer parseInteger(const string &s)
Convert text to QuantLib::Integer.
#define DLOG(text)
Logging Macro (Level = Debug)
Serializable Credit Default Swap.
Map text representations to QuantLib/QuantExt types.