27#include <boost/algorithm/string/join.hpp>
28#include <boost/lexical_cast.hpp>
29#include <boost/range/adaptor/transformed.hpp>
33using boost::adaptors::transformed;
34using boost::algorithm::join;
42template <
typename T>
const vector<T>& lookup(
const map<
string, vector<T>>& m,
const string& k) {
45 }
else if (m.count(std::string()) > 0) {
46 return m.at(std::string());
48 QL_FAIL(
"ScenarioSimMarketParameters: no vector for key \"" << k <<
"\" found.");
51template <
typename T>
const T& lookup(
const map<string, T>& m,
const string& k) {
54 }
else if (m.count(std::string()) > 0) {
55 return m.at(std::string());
57 QL_FAIL(
"ScenarioSimMarketParameters: no result for key \"" << k <<
"\" found.");
66 for (
auto n : it->second.second)
75 return std::find(it->second.second.begin(), it->second.second.end(),
name) == it->second.second.end() ? false
83 if (names.size() > 0) {
87 for (
auto name : names) {
95 bool simulate =
false;
98 simulate = it->second.first;
159 std::swap(*
this, ssmp);
284 const vector<Real> temp = lookup(
fxMoneyness_, ccypair);
296 QL_FAIL(
"no moneyness for commodity \"" << commodityName <<
"\" found.");
319 const string& smileDynamics) {
323 const string& smileDynamics) {
345 const std::vector<QuantLib::Rate>& strikes) {
701 DLOG(
"ScenarioSimMarketParameters::fromXML()");
708 DLOG(
"Loading Currencies");
712 DLOG(
"Loading BenchmarkCurve");
715 vector<string> yields;
725 DLOG(
"Loading YieldCurves");
744 WLOG(
"ScenarioSimMarket parameter Extrapolation should be FlatFwd or FlatZero, mapping deprecated "
746 <<
extrapolation_ <<
"' to FlatFwd. Please change this in your configuration.");
751 WLOG(
"Only one default interpolation value is allowed for yield curves");
754 WLOG(
"Only one default extrapolation value is allowed for yield curves");
763 DLOG(
"Loading Libor indices");
766 DLOG(
"Loading swap indices");
777 DLOG(
"Loading FX Rates");
789 for (
auto ccy :
ccys_) {
799 for (
auto ccy :
ccys_) {
806 DLOG(
"Loading SwaptionVolatilities");
817 keys.insert(keys.end(),
ccys.begin(),
ccys.end());
818 WLOG(
"ScenarioSimMarketParameters: SwaptionVolatilities/Currencies is deprecated, use Keys instead.");
821 QL_REQUIRE(!keys.empty(),
"SwaptionVolatilities needs at least one currency");
828 QL_REQUIRE(!expiryNodes.empty(),
"SwaptionVolatilities needs at least one Expiries node");
829 set<string> keysCheck(keys.begin(),keys.end());
830 bool defaultProvided =
false;
831 for (
XMLNode* expiryNode : expiryNodes) {
836 if (!ccyAttr.empty()) {
838 WLOG(
"ScenarioSimMarketParameters: SwaptionVolatilities/Expiries: 'ccy' attribute is deprecated, "
839 "use 'key' instead.");
844 "SwaptionVolatilities has duplicate expiries for key '" << key <<
"'");
845 keysCheck.erase(key);
846 defaultProvided = defaultProvided || key.empty();
848 QL_REQUIRE(defaultProvided || keysCheck.empty(),
"SwaptionVolatilities has no expiries for "
849 <<
"keys '" << join(keysCheck,
",")
850 <<
"' and no default expiry set has been given");
854 keysCheck = set<string>(keys.begin(), keys.end());
855 defaultProvided =
false;
856 for (
XMLNode* termNode : termNodes) {
861 if (!ccyAttr.empty()) {
863 WLOG(
"ScenarioSimMarketParameters: SwaptionVolatilities/Terms: 'ccy' attribute is deprecated, "
864 "use 'key' instead.");
868 QL_REQUIRE(
swapVolTerms_.insert(make_pair(key, terms)).second,
869 "SwaptionVolatilities has duplicate terms for key '" << key <<
"'");
870 keysCheck.erase(key);
871 defaultProvided = defaultProvided || key.empty();
873 QL_REQUIRE(defaultProvided || keysCheck.empty(),
"SwaptionVolatilities has no terms for "
874 <<
"keys '" << join(keysCheck,
",")
875 <<
"' and no default term set has been given");
879 for (
XMLNode* smileDynamicsNode : smileDynamicsNodes) {
890 if (spreadNodes.size() > 0) {
891 keysCheck = set<string>(keys.begin(), keys.end());
892 defaultProvided =
false;
893 for (
XMLNode* spreadNode : spreadNodes) {
898 if (!ccyAttr.empty()) {
900 ALOG(
"ScenarioSimMarketParameters: SwaptionVolatilities/StrikeSpreads: 'ccy' attribute is "
901 "deprecated, use 'key' instead.");
906 if (strStrike ==
"ATM" || strStrike ==
"0" || strStrike ==
"0.0") {
913 keysCheck.erase(key);
914 defaultProvided = defaultProvided || key.empty();
916 QL_REQUIRE(defaultProvided || keysCheck.empty(),
917 "SwaptionVolatilities has no strike spreads for "
918 <<
"currencies '" << join(keysCheck,
",")
919 <<
"' and no default strike spreads set has been given");
924 DLOG(
"Loading YieldVolatilities");
928 if (yieldVolSimNode) {
937 for (
XMLNode* smileDynamicsNode : smileDynamicsNodes) {
943 DLOG(
"Loading Correlations");
947 vector<string> pairs;
952 QL_REQUIRE(tokens.size() == 2,
"not a valid correlation pair: " << p);
972 DLOG(
"Loading CapFloorVolatilities");
986 keys.insert(keys.end(),
ccys.begin(),
ccys.end());
987 WLOG(
"ScenarioSimMarketParameters: CapFloorVolatilities/Currencies is deprecated, use Keys instead.");
990 QL_REQUIRE(!keys.empty(),
"CapFloorVolatilities needs at least one entry");
998 QL_REQUIRE(expiryNodes.size() > 0,
"CapFloorVolatilities needs at least one Expiries node");
999 set<string> keysCheck(keys.begin(), keys.end());
1000 bool defaultProvided =
false;
1001 for (
XMLNode* expiryNode : expiryNodes) {
1006 if (!ccyAttr.empty()) {
1008 WLOG(
"ScenarioSimMarketParameters: CapFloorVolatilities/Expiries: 'ccy' attribute is deprecated, "
1009 "use 'key' instead.");
1014 "CapFloorVolatilities has duplicate expiries for key '" << key <<
"'");
1015 keysCheck.erase(key);
1016 defaultProvided = defaultProvided || key.empty();
1018 QL_REQUIRE(defaultProvided || keysCheck.size() == 0,
"CapFloorVolatilities has no expiries for "
1019 <<
"keys '" << join(keysCheck,
",")
1020 <<
"' and no default expiry set has been given");
1024 QL_REQUIRE(strikeNodes.size() > 0,
"CapFloorVolatilities needs at least one Strikes node");
1025 keysCheck = std::set<std::string>(keys.begin(), keys.end());
1026 defaultProvided =
false;
1027 for (
XMLNode* strikeNode : strikeNodes) {
1031 if (!ccyAttr.empty()) {
1033 WLOG(
"ScenarioSimMarketParameters: CapFloorVolatilities/Strikes: 'ccy' attribute is deprecated, "
1034 "use 'key' instead.");
1041 if (strStrike ==
"ATM") {
1043 "CapFloorVolatilities has duplicate strikes for key '" << key <<
"'");
1046 "CapFloorVolatilities has duplicate strikes for key '" << key <<
"'");
1050 "CapFloorVolatilities has duplicate strikes for key '" << key <<
"'");
1051 keysCheck.erase(key);
1052 defaultProvided = defaultProvided || key.empty();
1054 QL_REQUIRE(defaultProvided || keysCheck.empty(),
"CapFloorVolatilities has no strikes for "
1055 <<
"key '" << join(keysCheck,
",")
1056 <<
"' and no default strike set has been given");
1072 for (
XMLNode* smileDynamicsNode : smileDynamicsNodes) {
1078 DLOG(
"Loading YYCapFloorVolatilities");
1084 if (yoyCapVolSimNode)
1090 QL_REQUIRE(yyIndices.size() > 0,
"YYCapFloorVolatilities needs at least on index");
1094 QL_REQUIRE(expiryNodes.size() > 0,
"YYCapFloorVolatilities needs at least one Expiries node");
1095 set<string> indicesCheck = yyIndices;
1096 bool defaultProvided =
false;
1097 for (
XMLNode* expiryNode : expiryNodes) {
1101 "YYCapFloorVolatlities has duplicate expiries for key '" << index <<
"'");
1102 indicesCheck.erase(index);
1103 defaultProvided = index ==
"";
1105 QL_REQUIRE(defaultProvided || indicesCheck.size() == 0,
"YYCapFloorVolatilites has no expiries for indices '"
1106 << join(indicesCheck,
";")
1107 <<
"' and no default expiry has been given");
1111 QL_REQUIRE(strikeNodes.size() > 0,
"CapFloorVolatilities needs at least one Strikes node");
1112 indicesCheck = yyIndices;
1113 defaultProvided =
false;
1114 for (
XMLNode* strikeNode : strikeNodes) {
1122 "YYInflationCapFloorVolatilities has duplicate strikes for key '" << index <<
"'");
1123 indicesCheck.erase(index);
1124 defaultProvided = index ==
"";
1126 QL_REQUIRE(defaultProvided || indicesCheck.size() == 0,
"YYInflationCapFloorVolatilities has no strikes for "
1127 <<
"currencies '" << join(indicesCheck,
",")
1128 <<
"' and no default strike set has been given");
1134 for (
XMLNode* smileDynamicsNode : smileDynamicsNodes) {
1140 DLOG(
"Loading CPICapFloorVolatilities");
1145 if (ziCapVolSimNode)
1151 QL_REQUIRE(
cpiIndices.size() > 0,
"CPICapFloorVolatilities needs at least on index");
1156 QL_REQUIRE(expiryNodes.size() > 0,
"CPICapFloorVolatilities needs at least one Expiries node");
1158 bool defaultProvided =
false;
1159 for (
XMLNode* expiryNode : expiryNodes) {
1163 "CPICapFloorVolatlities has duplicate expiries for key '" << index <<
"'");
1164 indicesCheck.erase(index);
1165 defaultProvided = index ==
"";
1167 QL_REQUIRE(defaultProvided || indicesCheck.size() == 0,
"CPICapFloorVolatilites has no expiries for indices '"
1168 << join(indicesCheck,
";")
1169 <<
"' and no default expiry has been given");
1174 QL_REQUIRE(strikeNodes.size() > 0,
"CPICapFloorVolatilities needs at least one Strikes node");
1176 defaultProvided =
false;
1177 for (
XMLNode* strikeNode : strikeNodes) {
1185 "CPIInflationCapFloorVolatilities has duplicate strikes for key '" << index <<
"'");
1186 indicesCheck.erase(index);
1187 defaultProvided = index ==
"";
1189 QL_REQUIRE(defaultProvided || indicesCheck.size() == 0,
"CPIInflationCapFloorVolatilities has no strikes for "
1190 <<
"currencies '" << join(indicesCheck,
",")
1191 <<
"' and no default strike set has been given");
1197 for (
XMLNode* smileDynamicsNode : smileDynamicsNodes) {
1203 DLOG(
"Loading DefaultCurves Rates");
1210 if (survivalProbabilitySimNode)
1213 if (recoveryRateSimNode)
1225 "default calendar is not set for defaultCurves");
1231 DLOG(
"Loading Equities Rates");
1235 if (dividendYieldSimNode)
1244 DLOG(
"Loading CDSVolatilities Rates");
1261 for (
XMLNode* smileDynamicsNode : smileDynamicsNodes) {
1267 DLOG(
"Loading FXVolatilities");
1279 QL_REQUIRE(names.size() > 0,
"FXVolatility needs at least one name");
1280 set<string> namesCheck = names;
1281 bool defaultProvided =
false;
1282 for (
XMLNode* expiryNode : expiryNodes) {
1287 "FXVolatilities has duplicate expiries for key '" <<
name <<
"'");
1288 namesCheck.erase(
name);
1289 defaultProvided =
name ==
"";
1291 QL_REQUIRE(defaultProvided || namesCheck.size() == 0,
"FXVolatilities has no expiries for "
1292 <<
"equities '" << join(namesCheck,
",") <<
"' and no default expiry set has been given");
1296 if (fxSurfaceNode) {
1312 "FX Volatility simulation parameters - both moneyness and standard deviations provided for "
1329 for (
XMLNode* smileDynamicsNode : smileDynamicsNodes) {
1335 DLOG(
"Loading EquityVolatilities");
1344 QL_REQUIRE(names.size() > 0,
"EquityVolatility needs at least one name");
1345 set<string> namesCheck = names;
1346 bool defaultProvided =
false;
1347 for (
XMLNode* expiryNode : expiryNodes) {
1352 "EquityVolatilities has duplicate expiries for key '" <<
name <<
"'");
1353 namesCheck.erase(
name);
1354 defaultProvided =
name ==
"";
1356 QL_REQUIRE(defaultProvided || namesCheck.size() == 0,
"EquityVolatilities has no expiries for " <<
1357 "equities '" << join(namesCheck,
",") <<
"' and no default expiry set has been given");
1361 if (eqSurfaceNode) {
1376 QL_FAIL(
"Equity Volatility simulation parameters - both moneyness and standard deviations provided for label " << label);
1392 for (
XMLNode* smileDynamicsNode : smileDynamicsNodes) {
1398 DLOG(
"Loading CpiInflationIndexCurves");
1401 DLOG(
"Loading ZeroInflationIndexCurves");
1408 DLOG(
"Loading YYInflationIndexCurves");
1416 DLOG(
"Loading AggregationScenarioDataIndices");
1421 DLOG(
"Loading AggregationScenarioDataCurrencies");
1427 DLOG(
"Loading Securities");
1437 DLOG(
"Loading CPRs");
1444 DLOG(
"Loading BaseCorrelations");
1454 DLOG(
"Loading commodities data");
1464 QL_REQUIRE(names.size() > 0,
"Commodities needs at least one name");
1471 QL_REQUIRE(tenorNodes.size() > 0,
"Commodities needs at least one Tenors node");
1472 set<string> namesCheck = names;
1473 bool defaultProvided =
false;
1474 for (
XMLNode* tenorNode : tenorNodes) {
1480 vector<Period> tenors;
1482 if (!strTenorList.empty()) {
1487 "Commodities has duplicate expiries for key '" <<
name <<
"'");
1488 namesCheck.erase(
name);
1489 defaultProvided =
name ==
"";
1491 QL_REQUIRE(defaultProvided || namesCheck.size() == 0,
"Commodities has no tenors for "
1492 <<
"names '" << join(namesCheck,
",")
1493 <<
"' and no default tenor set has been given");
1496 DLOG(
"Loading commodity volatility data");
1502 vector<string> names;
1509 names.push_back(
name);
1512 if (moneyness.empty())
1520 for (
XMLNode* smileDynamicsNode : smileDynamicsNodes) {
1526 DLOG(
"Loading credit states data");
1533 DLOG(
"Loading AggregationScenarioDataCreditStates");
1540 DLOG(
"Loading AggregationScenarioDataSurvivalWeights");
1544 DLOG(
"Loaded ScenarioSimMarketParameters");
1557 DLOG(
"Writing yield curves data");
1563 keys.insert(kv.first);
1565 QL_REQUIRE(keys.count(
"") > 0,
"There is no default yield curve configuration in simulation parameters");
1568 for (
const auto& key : keys) {
1583 DLOG(
"Writing FX rates");
1590 DLOG(
"Writing libor indices");
1596 DLOG(
"Writing swap indices");
1607 DLOG(
"Writing default curves");
1630 DLOG(
"Writing equities");
1639 DLOG(
"Writing swaption volatilities");
1662 XMLUtils::addChild(doc, swaptionVolatilitiesNode,
"SmileDynamics", it->second,
"key", it->first);
1668 DLOG(
"Writing yield volatilities");
1676 XMLUtils::addChild(doc, yieldVolatilitiesNode,
"SmileDynamics", it->second,
"key", it->first);
1682 DLOG(
"Writing cap/floor volatilities");
1692 string nodeValue = join(kv.second | transformed([](Period p) {
return ore::data::to_string(p); }),
",");
1702 string nodeValue = kv.second.empty()
1714 XMLUtils::addChild(doc, capFloorVolatilitiesNode,
"SmileDynamics", it->second,
"key", it->first);
1720 DLOG(
"Writing zero inflation cap/floor volatilities");
1728 string nodeValue = join(kv.second | transformed([](Period p) {
return ore::data::to_string(p); }),
",");
1736 string nodeValue = kv.second.empty()
1750 DLOG(
"Writing CDS volatilities");
1760 XMLUtils::addChild(doc, cdsVolatilitiesNode,
"SmileDynamics", it->second,
"key", it->first);
1766 DLOG(
"Writing FX volatilities");
1790 XMLUtils::addChild(doc, fxVolatilitiesNode,
"SmileDynamics", it->second,
"key", it->first);
1796 DLOG(
"Writing equity volatilities");
1820 XMLUtils::addChild(doc, eqVolatilitiesNode,
"SmileDynamics", it->second,
"key", it->first);
1827 DLOG(
"Writing benchmark yield curves data");
1835 DLOG(
"Writing securities");
1842 if (!
cprs().empty()) {
1843 DLOG(
"Writing cprs");
1851 DLOG(
"Writing inflation indices");
1857 DLOG(
"Writing zero inflation");
1865 DLOG(
"Writing year-on-year inflation");
1873 DLOG(
"Writing inflation cap/floor volatilities");
1881 string nodeValue = join(kv.second | transformed([](Period p) {
return ore::data::to_string(p); }),
",");
1889 string nodeValue = kv.second.empty()
1904 DLOG(
"Writing commodity price curves");
1913 string nodeValue = join(kv.second | transformed([](Period p) {
return ore::data::to_string(p); }),
",");
1922 DLOG(
"Writing commodity volatilities");
1935 XMLUtils::addChild(doc, commodityVolatilitiesNode,
"SmileDynamics", it->second,
"key", it->first);
1941 DLOG(
"Writing aggregation scenario data currencies");
1948 DLOG(
"Writing aggregation scenario data indices");
1954 DLOG(
"Writing number of credit states");
1958 DLOG(
"Writing number of credit states, AggregationScenarioDataCreditStates");
1964 DLOG(
"Writing names that need tracking of survival weights");
1972 DLOG(
"Writing base correlations");
1982 DLOG(
"Writing correlation");
1992 return simulationNode;
KeyType
Risk Factor types.
@ YoYInflationCapFloorVolatility
@ ZeroInflationCapFloorVolatility
ScenarioSimMarket description.
void setZeroInflationIndices(vector< string > names)
vector< string > cdsVolNames() const
void setFxCcyPairs(vector< string > names)
vector< string > baseCorrelationNames() const
bool simulateYieldVols() const
void setSwapVolSmileDynamics(const string &key, const string &smileDynamics)
void setCapFloorVolIsAtm(const std::string &key, bool isAtm)
map< string, vector< Period > > swapVolTerms_
map< string, bool > equityVolIsSurface_
void setEquityNames(vector< string > names)
void setSimulateFXVols(bool simulate)
map< string, vector< Period > > equityDividendTenors_
vector< string > paramsLookup(RiskFactorKey::KeyType k) const
vector< string > additionalScenarioDataIndices_
vector< string > equityNames() const
vector< std::string > correlationPairs() const
void setSimulateCorrelations(bool simulate)
bool simulateCorrelations() const
void setYieldVolNames(vector< string > names)
vector< string > swapVolKeys() const
bool simulateSwapVolATMOnly() const
bool fxUseMoneyness(const std::string &ccypair) const
const string & yieldVolSmileDynamics(const string &key) const
void setSimulateYoYInflationCapFloorVols(bool simulate)
std::map< std::string, std::vector< QuantLib::Period > > commodityVolExpiries_
void setSimulateSwapVols(bool simulate)
void setFxVolDecayMode(const string &val)
std::map< std::string, std::vector< QuantLib::Real > > commodityVolMoneyness_
const string & cdsVolSmileDynamics(const string &key) const
bool commodityVolSimulate() const
const map< string, vector< Period > > & yieldCurveTenors() const
const vector< QuantLib::Rate > & capFloorVolStrikes(const std::string &key) const
void setCapFloorVolStrikes(const std::string &key, const std::vector< QuantLib::Rate > &strikes)
map< string, vector< Real > > equityMoneyness_
void setYoyInflationTenors(const string &key, const vector< Period > &p)
bool fxVolIsSurface(const std::string &ccypair) const
void setDefaultTenors(const string &key, const vector< Period > &p)
void addParamsName(RiskFactorKey::KeyType kt, vector< string > names)
const vector< Real > & swapVolStrikeSpreads(const string &key) const
void setEquityVolSmileDynamics(const string &name, const string &smileDynamics)
const vector< Period > & swapVolTerms(const string &key) const
void setCommodityCurveSimulate(bool simulate)
vector< string > yieldCurveNames() const
const vector< Period > & yoyInflationCapFloorVolExpiries(const string &key) const
void setCommodityNames(vector< string > names)
bool simulateCdsVols() const
void setCommodityCurveTenors(const std::string &commodityName, const std::vector< QuantLib::Period > &p)
void setFxVolCcyPairs(vector< string > names)
void setCommodityVolSmileDynamics(const string &key, const string &smileDynamics)
void setYieldVolSmileDynamics(const string &key, const string &smileDynamics)
const vector< Real > & fxVolMoneyness(const string &ccypair) const
vector< string > yieldVolNames() const
const string & zeroInflationCapFloorVolSmileDynamics(const string &key) const
map< std::string, std::vector< QuantLib::Rate > > capFloorVolStrikes_
const std::vector< QuantLib::Real > & commodityVolMoneyness(const std::string &commodityName) const
bool paramsSimulate(RiskFactorKey::KeyType kt) const
void setEquityVolIsSurface(const string &name, bool isSurface)
vector< string > additionalScenarioDataCcys_
map< string, bool > swapVolIsCube_
bool equityVolIsSurface(const string &key) const
void setEquityVolMoneyness(const string &name, const vector< Real > &moneyness)
const string & commodityVolSmileDynamics(const string &commodityName) const
vector< string > fxVolCcyPairs() const
bool swapVolIsCube(const string &key) const
void setCdsVolNames(vector< string > names)
bool hasParamsName(RiskFactorKey::KeyType kt, string name) const
string yoyInflationCapFloorVolDecayMode_
vector< string > fxCcyPairs() const
void setCommodityCurves(vector< string > names)
void setZeroInflationCapFloorVolStrikes(const std::string &key, const std::vector< QuantLib::Rate > &strikes)
const string & yoyInflationCapFloorVolSmileDynamics(const string &key) const
vector< Real > baseCorrelationDetachmentPoints_
void setYoYInflationCapFloorVolSmileDynamics(const string &key, const string &smileDynamics)
void setCapFloorVolKeys(vector< string > names)
map< string, string > swapVolSmileDynamics_
bool simulateCapFloorVols() const
bool commodityCurveSimulate() const
bool simulateFXVols() const
vector< string > additionalScenarioDataSurvivalWeights_
std::vector< std::string > commodityVolNames() const
bool simulateRecoveryRates() const
void setZeroInflationCapFloorVolExpiries(const string &key, const vector< Period > &p)
void setFxVolStdDevs(const string &ccypair, const vector< Real > &stdDevs)
std::vector< std::string > commodityNames() const
void setSwapVolTerms(const string &key, const vector< Period > &p)
void setEquityVolExpiries(const string &name, const vector< Period > &expiries)
bool capFloorVolIsAtm(const std::string &key) const
const vector< Real > & fxVolStdDevs(const string &ccypair) const
void setZeroInflationCapFloorVolSmileDynamics(const string &key, const string &smileDynamics)
bool correlationIsSurface_
vector< Real > correlationStrikes_
const vector< Period > & capFloorVolExpiries(const string &key) const
map< string, string > commodityVolSmileDynamics_
const vector< Period > & defaultTenors(const string &key) const
map< string, vector< Real > > fxMoneyness_
bool simulateSurvivalProbabilities() const
map< string, string > fxVolSmileDynamics_
const vector< string > & ccys() const
const vector< Real > & equityVolMoneyness(const string &key) const
void setSimulateCapFloorVols(bool simulate)
bool operator!=(const ScenarioSimMarketParameters &rhs)
map< string, string > yieldVolSmileDynamics_
const std::vector< QuantLib::Period > & commodityCurveTenors(const std::string &commodityName) const
void setSwapVolStrikeSpreads(const std::string &key, const std::vector< QuantLib::Rate > &strikes)
void setCapFloorVolSmileDynamics(const string &key, const string &smileDynamics)
vector< string > zeroInflationIndices() const
const vector< Period > & equityDividendTenors(const string &key) const
void setCommodityVolSimulate(bool simulate)
const vector< Period > & zeroInflationCapFloorVolExpiries(const string &key) const
virtual void fromXML(XMLNode *node) override
string yieldVolDecayMode_
bool equityUseMoneyness(const string &key) const
map< string, vector< Period > > zeroInflationTenors_
const vector< Period > & swapVolExpiries(const string &key) const
const string & zeroInflationCapFloorVolDecayMode() const
bool simulateZeroInflationCapFloorVols() const
void setCprs(const vector< string > &names)
bool fxVolSimulateATMOnly_
map< string, vector< Real > > fxStandardDevs_
map< string, vector< Real > > swapVolStrikeSpreads_
Size numberOfCreditStates_
void setZeroInflationCapFloorNames(vector< string > names)
bool capFloorVolAdjustOptionletPillars_
string zeroInflationCapFloorVolDecayMode_
vector< Period > correlationExpiries_
map< std::string, bool > capFloorVolIsAtm_
string equityVolDecayMode_
void setSimulateEquityVols(bool simulate)
void setFxVolExpiries(const string &name, const vector< Period > &expiries)
std::map< RiskFactorKey::KeyType, std::pair< bool, std::set< std::string > > > params_
const vector< Period > & fxVolExpiries(const string &key) const
map< string, vector< Period > > swapVolExpiries_
const string & swapVolSmileDynamics(const string &key) const
bool simulateBaseCorrelations() const
void setRecoveryRates(vector< string > names)
void setSimulateCdsVolsATMOnly(bool simulateATMOnly)
map< string, string > zeroInflationCapFloorVolSmileDynamics_
vector< Period > baseCorrelationTerms_
void setSwapVolIsCube(const string &key, bool isCube)
map< string, string > yoyInflationCapFloorVolSmileDynamics_
string capFloorVolDecayMode_
void setSimulateRecoveryRates(bool simulate)
const vector< string > & cprs() const
std::string commodityVolDecayMode_
bool operator==(const ScenarioSimMarketParameters &rhs)
void setSimulateBaseCorrelations(bool simulate)
virtual XMLNode * toXML(ore::data::XMLDocument &doc) const override
void setCdsVolSmileDynamics(const string &key, const string &smileDynamics)
const vector< Real > & yoyInflationCapFloorVolStrikes(const std::string &key) const
void setCapFloorVolExpiries(const string &key, const vector< Period > &p)
map< string, vector< Period > > defaultTenors_
vector< string > zeroInflationCapFloorVolNames() const
string defaultCurveExtrapolation_
void setSimulateDividendYield(bool simulate)
const string & defaultCurveCalendar(const string &key) const
void setYieldCurveNames(vector< string > names)
map< string, string > defaultCurveCalendars_
vector< string > indices() const
Size additionalScenarioDataNumberOfCreditStates_
void setSimulateSurvivalProbabilities(bool simulate)
void setSimulateFxSpots(bool simulate)
map< string, string > capFloorVolSmileDynamics_
const string & yoyInflationCapFloorVolDecayMode() const
bool securitySpreadsSimulate() const
bool equityVolSimulateATMOnly_
bool hasCommodityCurveTenors(const std::string &commodityName) const
vector< string > defaultNames() const
void setSimulateCdsVols(bool simulate)
vector< string > equityVolNames() const
bool simulateEquityVols() const
vector< string > capFloorVolKeys() const
void setBaseCorrelationNames(vector< string > names)
map< string, vector< Period > > zeroInflationCapFloorVolExpiries_
bool simulateYoYInflationCapFloorVols() const
map< string, vector< Period > > capFloorVolExpiries_
void setFxVolIsSurface(const string &ccypair, bool val)
void setFxVolSmileDynamics(const string &name, const string &smileDynamics)
map< string, vector< Period > > fxVolExpiries_
void setParamsSimulate(RiskFactorKey::KeyType kt, bool simulate)
map< string, vector< Period > > yieldCurveTenors_
void setSimulateEquityVolATMOnly(bool simulateATMOnly)
const vector< Real > & zeroInflationCapFloorVolStrikes(const string &key) const
const string & equityVolSmileDynamics(const string &key) const
vector< Period > cdsVolExpiries_
void setSecuritySpreadsSimulate(bool simulate)
bool simulateCprs() const
const vector< Period > & yoyInflationTenors(const string &key) const
const vector< Period > & equityVolExpiries(const string &key) const
void setSimulateZeroInflationCapFloorVols(bool simulate)
const string & fxVolSmileDynamics(const string &key) const
std::map< std::string, std::vector< QuantLib::Period > > commodityCurveTenors_
map< string, vector< Period > > yoyInflationCapFloorVolExpiries_
map< string, vector< Period > > yoyInflationTenors_
void reset()
A method used to reset the object to its default state before fromXML is called.
void setSimulateCprs(bool simulate)
vector< string > cpiIndices() const
map< std::string, std::vector< QuantLib::Rate > > zeroInflationCapFloorVolStrikes_
vector< string > yoyInflationIndices() const
vector< Period > yieldVolTerms_
void setEquityDividendTenors(const string &key, const vector< Period > &p)
const std::vector< QuantLib::Period > & commodityVolExpiries(const std::string &commodityName) const
void setYoyInflationIndices(vector< string > names)
void setDefaultNames(vector< string > names)
void setDefaultCurveCalendars(const string &key, const string &p)
map< string, string > equityVolSmileDynamics_
void setYoYInflationCapFloorVolExpiries(const string &key, const vector< Period > &p)
void setSwapVolKeys(vector< string > names)
void setEquityDividendCurves(vector< string > names)
void setEquityVolNames(vector< string > names)
map< string, vector< Period > > equityVolExpiries_
const vector< Real > & equityVolStandardDevs(const string &key) const
map< std::string, std::vector< QuantLib::Rate > > yoyInflationCapFloorVolStrikes_
void setSimulateYieldVols(bool simulate)
bool simulateDividendYield() const
vector< string > yoyInflationCapFloorVolNames() const
void setYieldCurveTenors(const string &key, const vector< Period > &p)
vector< Period > yieldVolExpiries_
bool capFloorVolUseCapAtm_
void setYoYInflationCapFloorVolStrikes(const std::string &key, const std::vector< QuantLib::Rate > &strikes)
void setFxVolMoneyness(const string &ccypair, const vector< Real > &moneyness)
void setCorrelationPairs(vector< string > names)
const vector< Period > & zeroInflationTenors(const string &key) const
void setCpiIndices(vector< string > names)
bool cdsVolSimulateATMOnly_
bool simulateSwapVols() const
void setEquityVolStandardDevs(const string &name, const vector< Real > &standardDevs)
void setYoYInflationCapFloorVolNames(vector< string > names)
map< string, vector< Real > > equityStandardDevs_
void setCommodityVolNames(vector< string > names)
bool swapVolSimulateATMOnly_
void setSecurities(vector< string > names)
map< string, string > swapIndices_
void setSimulateFxVolATMOnly(bool simulateATMOnly)
void setSwapVolExpiries(const string &key, const vector< Period > &p)
void setDiscountCurveNames(vector< string > names)
map< string, string > yieldCurveCurrencies_
void setIndices(vector< string > names)
vector< string > securities() const
map< string, string > cdsVolSmileDynamics_
map< std::string, bool > fxVolIsSurface_
const string & capFloorVolSmileDynamics(const string &key) const
void setZeroInflationTenors(const string &key, const vector< Period > &p)
XMLNode * allocNode(const string &nodeName)
static void addAttribute(XMLDocument &doc, XMLNode *node, const string &attrName, const string &attrValue)
static void addChildren(XMLDocument &doc, XMLNode *n, const string &names, const string &name, const vector< T > &values)
static string getAttribute(XMLNode *node, const string &attrName)
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 vector< XMLNode * > getChildrenNodes(XMLNode *node, const string &name)
static XMLNode * locateNode(XMLNode *n, const string &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)
static int getChildValueAsInt(XMLNode *node, const string &name, bool mandatory=false, int defaultValue=0)
static XMLNode * getNextSibling(XMLNode *node, const string &name="")
static vector< Real > getChildrenValuesAsDoublesCompact(XMLNode *node, const string &name, bool mandatory=false)
static vector< string > getChildrenValues(XMLNode *node, const string &names, const string &name, bool mandatory=false)
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
static void appendNode(XMLNode *parent, XMLNode *child)
static vector< Period > getChildrenValuesAsPeriods(XMLNode *node, const string &name, bool mandatory=false)
static vector< Real > getNodeValueAsDoublesCompact(XMLNode *node)
Period parsePeriod(const string &s)
bool parseBool(const string &s)
Real parseReal(const string &s)
std::vector< std::string > getCorrelationTokens(const std::string &name)
Size size(const ValueType &v)
std::string to_string(const LocationInfo &l)
A class to hold Scenario parameters for scenarioSimMarket.