Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
inputparameters.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2022 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
21#include <orea/cube/cube_io.hpp>
33
34namespace ore {
35namespace analytics {
36
37vector<string> getFileNames(const string& fileString, const std::filesystem::path& path) {
38 vector<string> fileNames;
39 boost::split(fileNames, fileString, boost::is_any_of(",;"), boost::token_compress_on);
40 for (auto it = fileNames.begin(); it < fileNames.end(); it++) {
41 boost::trim(*it);
42 *it = (path / *it).generic_string();
43 }
44 return fileNames;
45}
46
48 iborFallbackConfig_ = QuantLib::ext::make_shared<IborFallbackConfig>(IborFallbackConfig::defaultConfig());
49 simmBucketMapper_ = QuantLib::ext::make_shared<SimmBucketMapperBase>();
51}
52
53void InputParameters::setAsOfDate(const std::string& s) {
54 asof_ = parseDate(s);
55 Settings::instance().evaluationDate() = asof_;
56}
57
58void InputParameters::setMarketConfig(const std::string& config, const std::string& context) {
59 auto it = marketConfigs_.find(context);
60 QL_REQUIRE(it == marketConfigs_.end(),
61 "market config " << it->second << " already set for context " << it->first);
62 marketConfigs_[context] = config;
63}
64
65void InputParameters::setRefDataManager(const std::string& xml) {
66 refDataManager_ = QuantLib::ext::make_shared<BasicReferenceDataManager>();
67 refDataManager_->fromXMLString(xml);
68}
69
70void InputParameters::setRefDataManagerFromFile(const std::string& fileName) {
71 refDataManager_ = QuantLib::ext::make_shared<BasicReferenceDataManager>(fileName);
72}
73
74void InputParameters::setScriptLibrary(const std::string& xml) {
76 data.fromXMLString(xml);
77 ScriptLibraryStorage::instance().set(std::move(data));
78}
79
80void InputParameters::setScriptLibraryFromFile(const std::string& fileName) {
82 data.fromFile(fileName);
83 ScriptLibraryStorage::instance().set(std::move(data));
84}
85
86void InputParameters::setConventions(const std::string& xml) {
87 conventions_ = QuantLib::ext::make_shared<Conventions>();
88 conventions_->fromXMLString(xml);
89}
90
91void InputParameters::setConventionsFromFile(const std::string& fileName) {
92 conventions_ = QuantLib::ext::make_shared<Conventions>();
93 conventions_->fromFile(fileName);
94}
95
96void InputParameters::setCurveConfigs(const std::string& xml) {
97 auto curveConfig = QuantLib::ext::make_shared<CurveConfigurations>();
98 curveConfig->fromXMLString(xml);
99 curveConfigs_.add(curveConfig);
100}
101
102void InputParameters::setCurveConfigsFromFile(const std::string& fileName) {
103 auto curveConfig = QuantLib::ext::make_shared<CurveConfigurations>();
104 curveConfig->fromFile(fileName);
105 curveConfigs_.add(curveConfig);
106}
107
108void InputParameters::setIborFallbackConfig(const std::string& xml) {
109 iborFallbackConfig_= QuantLib::ext::make_shared<IborFallbackConfig>();
110 iborFallbackConfig_->fromXMLString(xml);
111}
112
113void InputParameters::setIborFallbackConfigFromFile(const std::string& fileName) {
114 iborFallbackConfig_= QuantLib::ext::make_shared<IborFallbackConfig>();
115 iborFallbackConfig_->fromFile(fileName);
116}
117
118void InputParameters::setPricingEngine(const std::string& xml) {
119 pricingEngine_ = QuantLib::ext::make_shared<EngineData>();
120 pricingEngine_->fromXMLString(xml);
121}
122
123void InputParameters::setPricingEngineFromFile(const std::string& fileName) {
124 pricingEngine_ = QuantLib::ext::make_shared<EngineData>();
125 pricingEngine_->fromFile(fileName);
126}
127
128void InputParameters::setTodaysMarketParams(const std::string& xml) {
129 todaysMarketParams_ = QuantLib::ext::make_shared<TodaysMarketParameters>();
130 todaysMarketParams_->fromXMLString(xml);
131}
132
133void InputParameters::setTodaysMarketParamsFromFile(const std::string& fileName) {
134 todaysMarketParams_ = QuantLib::ext::make_shared<TodaysMarketParameters>();
135 todaysMarketParams_->fromFile(fileName);
136}
137
138void InputParameters::setPortfolio(const std::string& xml) {
139 portfolio_ = QuantLib::ext::make_shared<Portfolio>(buildFailedTrades_);
140 portfolio_->fromXMLString(xml);
141}
142
143void InputParameters::setPortfolioFromFile(const std::string& fileNameString, const std::filesystem::path& inputPath) {
144 vector<string> files = getFileNames(fileNameString, inputPath);
145 portfolio_ = QuantLib::ext::make_shared<Portfolio>(buildFailedTrades_);
146 for (auto file : files) {
147 LOG("Loading portfolio from file: " << file);
148 portfolio_->fromFile(file);
149 }
150}
151
152void InputParameters::setMarketConfigs(const std::map<std::string, std::string>& m) {
153 marketConfigs_ = m;
154}
155
156void InputParameters::setMporCalendar(const std::string& s) {
158}
159
160void InputParameters::setSensiSimMarketParams(const std::string& xml) {
161 sensiSimMarketParams_ = QuantLib::ext::make_shared<ScenarioSimMarketParameters>();
162 sensiSimMarketParams_->fromXMLString(xml);
163}
164
165void InputParameters::setSensiSimMarketParamsFromFile(const std::string& fileName) {
166 sensiSimMarketParams_ = QuantLib::ext::make_shared<ScenarioSimMarketParameters>();
167 sensiSimMarketParams_->fromFile(fileName);
168}
169
170void InputParameters::setSensiScenarioData(const std::string& xml) {
171 sensiScenarioData_ = QuantLib::ext::make_shared<SensitivityScenarioData>();
172 sensiScenarioData_->fromXMLString(xml);
173}
174
175void InputParameters::setSensiScenarioDataFromFile(const std::string& fileName) {
176 sensiScenarioData_ = QuantLib::ext::make_shared<SensitivityScenarioData>();
177 sensiScenarioData_->fromFile(fileName);
178}
179
180void InputParameters::setSensiPricingEngine(const std::string& xml) {
181 sensiPricingEngine_ = QuantLib::ext::make_shared<EngineData>();
182 sensiPricingEngine_->fromXMLString(xml);
183}
184
186 scenarioSimMarketParams_ = QuantLib::ext::make_shared<ScenarioSimMarketParameters>();
187 scenarioSimMarketParams_->fromXMLString(xml);
188}
189
191 scenarioSimMarketParams_ = QuantLib::ext::make_shared<ScenarioSimMarketParameters>();
192 scenarioSimMarketParams_->fromFile(fileName);
193}
194
195void InputParameters::setHistVarSimMarketParamsFromFile(const std::string& fileName) {
196 histVarSimMarketParams_ = QuantLib::ext::make_shared<ScenarioSimMarketParameters>();
197 histVarSimMarketParams_->fromFile(fileName);
198}
199
200void InputParameters::setSensiPricingEngineFromFile(const std::string& fileName) {
201 sensiPricingEngine_ = QuantLib::ext::make_shared<EngineData>();
202 sensiPricingEngine_->fromFile(fileName);
203}
204
205void InputParameters::setStressSimMarketParams(const std::string& xml) {
206 stressSimMarketParams_ = QuantLib::ext::make_shared<ScenarioSimMarketParameters>();
207 stressSimMarketParams_->fromXMLString(xml);
208}
209
210void InputParameters::setStressSimMarketParamsFromFile(const std::string& fileName) {
211 stressSimMarketParams_ = QuantLib::ext::make_shared<ScenarioSimMarketParameters>();
212 stressSimMarketParams_->fromFile(fileName);
213}
214
215void InputParameters::setStressScenarioData(const std::string& xml) {
216 stressScenarioData_ = QuantLib::ext::make_shared<StressTestScenarioData>();
217 stressScenarioData_->fromXMLString(xml);
218}
219
220void InputParameters::setStressScenarioDataFromFile(const std::string& fileName) {
221 stressScenarioData_ = QuantLib::ext::make_shared<StressTestScenarioData>();
222 stressScenarioData_->fromFile(fileName);
223}
224
226 stressSensitivityScenarioData_ = boost::make_shared<SensitivityScenarioData>();
227 stressSensitivityScenarioData_->fromXMLString(xml);
228}
229
231 stressSensitivityScenarioData_ = boost::make_shared<SensitivityScenarioData>();
232 stressSensitivityScenarioData_->fromFile(fileName);
233}
234
235void InputParameters::setStressPricingEngine(const std::string& xml) {
236 stressPricingEngine_ = QuantLib::ext::make_shared<EngineData>();
237 stressPricingEngine_->fromXMLString(xml);
238}
239
240void InputParameters::setStressPricingEngineFromFile(const std::string& fileName) {
241 stressPricingEngine_ = QuantLib::ext::make_shared<EngineData>();
242 stressPricingEngine_->fromFile(fileName);
243}
244
246 exposureSimMarketParams_ = QuantLib::ext::make_shared<ScenarioSimMarketParameters>();
247 exposureSimMarketParams_->fromXMLString(xml);
248}
249
251 exposureSimMarketParams_ = QuantLib::ext::make_shared<ScenarioSimMarketParameters>();
252 exposureSimMarketParams_->fromFile(fileName);
253}
254
255void InputParameters::setScenarioGeneratorData(const std::string& xml) {
256 scenarioGeneratorData_ = QuantLib::ext::make_shared<ScenarioGeneratorData>();
257 scenarioGeneratorData_->fromXMLString(xml);
258}
259
260void InputParameters::setScenarioGeneratorDataFromFile(const std::string& fileName) {
261 scenarioGeneratorData_ = QuantLib::ext::make_shared<ScenarioGeneratorData>();
262 scenarioGeneratorData_->fromFile(fileName);
263}
264
265void InputParameters::setCrossAssetModelData(const std::string& xml) {
266 crossAssetModelData_ = QuantLib::ext::make_shared<CrossAssetModelData>();
267 crossAssetModelData_->fromXMLString(xml);
268}
269
270void InputParameters::setCrossAssetModelDataFromFile(const std::string& fileName) {
271 crossAssetModelData_ = QuantLib::ext::make_shared<CrossAssetModelData>();
272 crossAssetModelData_->fromFile(fileName);
273}
274
276 simulationPricingEngine_ = QuantLib::ext::make_shared<EngineData>();
277 simulationPricingEngine_->fromXMLString(xml);
278}
279
281 simulationPricingEngine_ = QuantLib::ext::make_shared<EngineData>();
282 simulationPricingEngine_->fromFile(fileName);
283}
284
285void InputParameters::setAmcPricingEngine(const std::string& xml) {
286 amcPricingEngine_ = QuantLib::ext::make_shared<EngineData>();
287 amcPricingEngine_->fromXMLString(xml);
288}
289
290void InputParameters::setXvaCgSensiScenarioData(const std::string& xml) {
291 xvaCgSensiScenarioData_ = QuantLib::ext::make_shared<SensitivityScenarioData>();
292 xvaCgSensiScenarioData_->fromXMLString(xml);
293}
294
295void InputParameters::setXvaCgSensiScenarioDataFromFile(const std::string& fileName) {
296 xvaCgSensiScenarioData_ = QuantLib::ext::make_shared<SensitivityScenarioData>();
297 xvaCgSensiScenarioData_->fromFile(fileName);
298}
299
301 xvaStressSimMarketParams_ = QuantLib::ext::make_shared<ScenarioSimMarketParameters>();
302 xvaStressSimMarketParams_->fromXMLString(xml);
303}
304
306 xvaStressSimMarketParams_ = QuantLib::ext::make_shared<ScenarioSimMarketParameters>();
307 xvaStressSimMarketParams_->fromFile(fileName);
308}
309
310void InputParameters::setXvaStressScenarioData(const std::string& xml) {
311 xvaStressScenarioData_ = QuantLib::ext::make_shared<StressTestScenarioData>();
312 xvaStressScenarioData_->fromXMLString(xml);
313}
314
315void InputParameters::setXvaStressScenarioDataFromFile(const std::string& fileName) {
316 xvaStressScenarioData_ = QuantLib::ext::make_shared<StressTestScenarioData>();
317 xvaStressScenarioData_->fromFile(fileName);
318}
319
321 xvaStressSensitivityScenarioData_ = boost::make_shared<SensitivityScenarioData>();
322 xvaStressSensitivityScenarioData_->fromXMLString(xml);
323}
324
326 xvaStressSensitivityScenarioData_ = boost::make_shared<SensitivityScenarioData>();
327 xvaStressSensitivityScenarioData_->fromFile(fileName);
328}
329
331 xvaSensiSimMarketParams_ = QuantLib::ext::make_shared<ScenarioSimMarketParameters>();
332 xvaSensiSimMarketParams_->fromXMLString(xml);
333}
335 xvaSensiSimMarketParams_ = QuantLib::ext::make_shared<ScenarioSimMarketParameters>();
336 xvaSensiSimMarketParams_->fromFile(fileName);
337}
338void InputParameters::setXvaSensiScenarioData(const std::string& xml) {
339 xvaSensiScenarioData_ = boost::make_shared<SensitivityScenarioData>();
340 xvaSensiScenarioData_->fromXMLString(xml);
341}
342void InputParameters::setXvaSensiScenarioDataFromFile(const std::string& fileName) {
343 xvaSensiScenarioData_ = boost::make_shared<SensitivityScenarioData>();
344 xvaSensiScenarioData_->fromFile(fileName);
345}
346void InputParameters::setXvaSensiPricingEngine(const std::string& xml) {
347 xvaSensiPricingEngine_ = QuantLib::ext::make_shared<EngineData>();
348 xvaSensiPricingEngine_->fromXMLString(xml);
349}
350void InputParameters::setXvaSensiPricingEngineFromFile(const std::string& fileName) {
351 xvaSensiPricingEngine_ = QuantLib::ext::make_shared<EngineData>();
352 xvaSensiPricingEngine_->fromFile(fileName);
353}
354
355void InputParameters::setAmcPricingEngineFromFile(const std::string& fileName) {
356 amcPricingEngine_ = QuantLib::ext::make_shared<EngineData>();
357 amcPricingEngine_->fromFile(fileName);
358}
359
360void InputParameters::setNettingSetManager(const std::string& xml) {
361 nettingSetManager_ = QuantLib::ext::make_shared<NettingSetManager>();
362 nettingSetManager_->fromXMLString(xml);
363}
364
365void InputParameters::setNettingSetManagerFromFile(const std::string& fileName) {
366 nettingSetManager_ = QuantLib::ext::make_shared<NettingSetManager>();
367 nettingSetManager_->fromFile(fileName);
368}
369
370void InputParameters::setCollateralBalances(const std::string& xml) {
371 collateralBalances_ = QuantLib::ext::make_shared<CollateralBalances>();
372 collateralBalances_->fromXMLString(xml);
373}
374
375void InputParameters::setCollateralBalancesFromFile(const std::string& fileName) {
376 collateralBalances_ = QuantLib::ext::make_shared<CollateralBalances>();
377 collateralBalances_->fromFile(fileName);
378}
379
380void InputParameters::setCubeFromFile(const std::string& file) {
381 auto r = ore::analytics::loadCube(file);
382 cube_ = r.cube;
383 if(r.scenarioGeneratorData)
384 scenarioGeneratorData_ = r.scenarioGeneratorData;
385 if(r.storeFlows)
386 storeFlows_ = *r.storeFlows;
387 if(r.storeCreditStateNPVs)
388 storeCreditStateNPVs_ = *r.storeCreditStateNPVs;
389}
390
391void InputParameters::setCube(const ext::shared_ptr<NPVCube>& cube) {
392 cube_ = cube;
393}
394
395void InputParameters::setNettingSetCubeFromFile(const std::string& file) {
397}
398
399void InputParameters::setCptyCubeFromFile(const std::string& file) {
401}
402
404
405void InputParameters::setMarketCube(const QuantLib::ext::shared_ptr<AggregationScenarioData>& cube) { mktCube_ = cube; }
406
407void InputParameters::setVarQuantiles(const std::string& s) {
408 // parse to vector<Real>
409 varQuantiles_ = parseListOfValues<Real>(s, &parseReal);
410}
411
412void InputParameters::setCovarianceDataFromFile(const std::string& fileName) {
413 ore::data::CSVFileReader reader(fileName, false);
414 std::vector<std::string> dummy;
415 while (reader.next()) {
416 covarianceData_[std::make_pair(*parseRiskFactorKey(reader.get(0), dummy),
417 *parseRiskFactorKey(reader.get(1), dummy))] =
418 ore::data::parseReal(reader.get(2));
419 }
420 LOG("Read " << covarianceData_.size() << " valid covariance data lines from " << fileName);
421}
422
424 std::vector<std::string> dummy;
425 while (reader.next()) {
426 covarianceData_[std::make_pair(*parseRiskFactorKey(reader.get(0), dummy),
427 *parseRiskFactorKey(reader.get(1), dummy))] =
428 ore::data::parseReal(reader.get(2));
429 }
430 LOG("Read " << covarianceData_.size() << " valid covariance data lines");
431}
432
434 ore::data::CSVBufferReader reader(xml, false);
435 setCovarianceData(reader);
436}
437
438void InputParameters::setSensitivityStreamFromFile(const std::string& fileName) {
439 sensitivityStream_ = QuantLib::ext::make_shared<SensitivityFileStream>(fileName);
440}
441
442void InputParameters::setSensitivityStreamFromBuffer(const std::string& buffer) {
443 sensitivityStream_ = QuantLib::ext::make_shared<SensitivityBufferStream>(buffer);
444}
445
446void InputParameters::setBenchmarkVarPeriod(const std::string& period) {
447 benchmarkVarPeriod_ = period;
448}
449
450void InputParameters::setHistoricalScenarioReader(const std::string& fileName) {
451 boost::filesystem::path baseScenarioPath(fileName);
452 QL_REQUIRE(exists(baseScenarioPath), "The provided base scenario file, " << baseScenarioPath << ", does not exist");
453 QL_REQUIRE(is_regular_file(baseScenarioPath),
454 "The provided base scenario file, " << baseScenarioPath << ", is not a file");
455 historicalScenarioReader_ = QuantLib::ext::make_shared<HistoricalScenarioFileReader>(
456 fileName, QuantLib::ext::make_shared<SimpleScenarioFactory>(false));
457}
458
459void InputParameters::setAmcTradeTypes(const std::string& s) {
460 // parse to set<string>
461 auto v = parseListOfValues(s);
462 amcTradeTypes_ = std::set<std::string>(v.begin(), v.end());
463}
464
465void InputParameters::setCvaSensiGrid(const std::string& s) {
466 // parse to vector<Period>
467 cvaSensiGrid_ = parseListOfValues<Period>(s, &parsePeriod);
468}
469
471 // Minimum requirement: The file has a header line and contains at least
472 // columns "Date", "NettingSet" and "InitialMargin".
473 // We don't assume that data is sorted by netting set or date.
474 ore::data::CSVFileReader reader(fileName, true);
475 std::map<std::string, std::map<Date, Real>> data;
476 while (reader.next()) {
477 Date date = parseDate(reader.get("Date"));
478 std::string nettingSet = reader.get("NettingSet");
479 Real initialMargin = parseReal(reader.get("InitialMargin"));
480 // LOG("IM Evolution NettingSet " << nettingSet << ": "
481 // << io::iso_date(date) << " " << initialMargin);
482 if (data.find(nettingSet) == data.end())
483 data[nettingSet] = std::map<Date,Real>();
484 std::map<Date,Real>& evolution = data[nettingSet];
485 evolution[date] = initialMargin;
486 }
487 for (auto d : data) {
488 std::string n = d.first;
489 LOG("Loading IM evolution for netting set " << n << ", size " << d.second.size());
490 vector<Real> im;
491 vector<Date> date;
492 for (auto row : d.second) {
493 im.push_back(row.second);
494 date.push_back(row.first);
495 }
496 TimeSeries<Real> ts(date.begin(), date.end(), im.begin());
497 // for (auto d : ts.dates())
498 // LOG("TimeSeries " << io::iso_date(d) << " " << ts[d]);
500 WLOG("External IM evolution for NettingSet " << n << " loaded");
501 }
502}
503
504void InputParameters::setDimRegressors(const std::string& s) {
505 // parse to vector<string>
507}
508
509void InputParameters::setDimOutputGridPoints(const std::string& s) {
510 // parse to vector<Size>
511 dimOutputGridPoints_ = parseListOfValues<Size>(s, &parseInteger);
512}
513
514void InputParameters::setCashflowHorizon(const std::string& s) {
515 // parse to Date
517}
518
519void InputParameters::setPortfolioFilterDate(const std::string& s) {
520 // parse to Date
522}
523
525 creditSimulationParameters_ = QuantLib::ext::make_shared<CreditSimulationParameters>();
526 creditSimulationParameters_->fromFile(fileName);
527}
528
530 creditSimulationParameters_ = QuantLib::ext::make_shared<CreditSimulationParameters>();
531 creditSimulationParameters_->fromXMLString(xml);
532}
533
534void InputParameters::setCrifFromFile(const std::string& fileName, char eol, char delim, char quoteChar, char escapeChar) {
535 bool updateMappings = true;
536 bool aggregateTrades = false;
537 auto crifLoader = CsvFileCrifLoader(fileName, getSimmConfiguration(), CrifRecord::additionalHeaders, updateMappings,
538 aggregateTrades, eol, delim, quoteChar, escapeChar, reportNaString());
539 crif_ = crifLoader.loadCrif();
540}
541
542void InputParameters::setCrifFromBuffer(const std::string& csvBuffer, char eol, char delim, char quoteChar, char escapeChar) {
543 bool updateMappings = true;
544 bool aggregateTrades = false;
545 auto crifLoader =
547 aggregateTrades, eol, delim, quoteChar, escapeChar, reportNaString());
548 crif_ = crifLoader.loadCrif();
549}
550
551void InputParameters::setSimmNameMapper(const std::string& xml) {
552 simmNameMapper_ = QuantLib::ext::make_shared<SimmBasicNameMapper>();
553 simmNameMapper_->fromXMLString(xml);
554}
555
556void InputParameters::setSimmNameMapperFromFile(const std::string& fileName) {
557 simmNameMapper_ = QuantLib::ext::make_shared<SimmBasicNameMapper>();
558 simmNameMapper_->fromFile(fileName);
559}
560
561void InputParameters::setSimmBucketMapper(const std::string& xml) {
562 QL_REQUIRE(simmVersion_ != "", "SIMM version not set");
563 QL_REQUIRE(simmBucketMapper_ != nullptr, "SIMMbucket mapper not set");
564 //QuantLib::ext::shared_ptr<SimmBucketMapperBase> sbm = QuantLib::ext::dynamic_pointer_cast<SimmBucketMapperBase>();
565 QuantLib::ext::shared_ptr<SimmBucketMapperBase> sbm = QuantLib::ext::dynamic_pointer_cast<SimmBucketMapperBase>(simmBucketMapper_);
566 sbm->fromXMLString(xml);
567}
568
569void InputParameters::setSimmBucketMapperFromFile(const std::string& fileName) {
570 QL_REQUIRE(simmVersion_ != "", "SIMM version not set");
571 QL_REQUIRE(simmBucketMapper_ != nullptr, "SIMMbucket mapper not set");
572 QuantLib::ext::shared_ptr<SimmBucketMapperBase> sbm = QuantLib::ext::dynamic_pointer_cast<SimmBucketMapperBase>(simmBucketMapper_);
573 sbm->fromFile(fileName);
574}
575
576void InputParameters::setSimmCalibrationDataFromFile(const std::string& fileName) {
577 simmCalibrationData_ = QuantLib::ext::make_shared<SimmCalibrationData>();
578 simmCalibrationData_->fromFile(fileName);
579}
580
581void InputParameters::setAnalytics(const std::string& s) {
582 // parse to set<string>
583 auto v = parseListOfValues(s);
584 analytics_ = std::set<std::string>(v.begin(), v.end());
585}
586
587void InputParameters::insertAnalytic(const std::string& s) {
588 analytics_.insert(s);
589}
590
591OutputParameters::OutputParameters(const QuantLib::ext::shared_ptr<Parameters>& params) {
592 LOG("OutputFileNameMap called");
593 npvOutputFileName_ = params->get("npv", "outputFileName", false);
594 cashflowOutputFileName_ = params->get("cashflow", "outputFileName", false);
595 curvesOutputFileName_ = params->get("curves", "outputFileName", false);
596 scenarioDumpFileName_ = params->get("simulation", "scenariodump", false);
597 scenarioOutputName_ = params->get("scenario", "scenarioOutputFile", false);
598 cubeFileName_ = params->get("simulation", "cubeFile", false);
599 mktCubeFileName_ = params->get("simulation", "aggregationScenarioDataFileName", false);
600 rawCubeFileName_ = params->get("xva", "rawCubeOutputFile", false);
601 netCubeFileName_ = params->get("xva", "netCubeOutputFile", false);
602 dimEvolutionFileName_ = params->get("xva", "dimEvolutionFile", false);
603 std::string tmp = params->get("xva", "dimRegressionFiles", false);
604 if (tmp != "")
606 sensitivityFileName_ = params->get("sensitivity", "sensitivityOutputFile", false);
607 parSensitivityFileName_ = params->get("sensitivity", "parSensitivityOutputFile", false);
608 jacobiFileName_ = params->get("sensitivity", "jacobiOutputFile", false);
609 jacobiInverseFileName_ = params->get("sensitivity", "jacobiInverseOutputFile", false);
610 sensitivityScenarioFileName_ = params->get("sensitivity", "scenarioOutputFile", false);
611 stressTestFileName_ = params->get("stress", "scenarioOutputFile", false);
612 stressZeroScenarioDataFileName_ = params->get("stress", "stressZeroScenarioDataFile", false);
613 xvaStressTestFileName_ = params->get("xvaStress", "scenarioOutputFile", false);
614 varFileName_ = params->get("parametricVar", "outputFile", false);
615 if (varFileName_.empty())
616 varFileName_ = params->get("historicalSimulationVar", "outputFile", false);
617 parConversionOutputFileName_ = params->get("zeroToParSensiConversion", "outputFile", false);
618 parConversionJacobiFileName_ = params->get("zeroToParSensiConversion", "jacobiOutputFile", false);
619 parConversionJacobiInverseFileName_ = params->get("zeroToParSensiConversion", "jacobiInverseOutputFile", false);
620 pnlOutputFileName_ = params->get("pnl", "outputFileName", false);
621 parStressTestConversionFile_ = params->get("parStressConversion", "stressZeroScenarioDataFile", false);
622 pnlExplainOutputFileName_ = params->get("pnlExplain", "outputFileName", false);
623
624 zeroToParShiftFile_ = params->get("zeroToParShift", "parShiftsFile", false);
625 // map internal report name to output file name
629 fileNameMap_["cube"] = cubeFileName_;
630 fileNameMap_["scenariodata"] = mktCubeFileName_;
632 fileNameMap_["rawcube"] = rawCubeFileName_;
633 fileNameMap_["netcube"] = netCubeFileName_;
634 fileNameMap_["dim_evolution"] = dimEvolutionFileName_;
635 fileNameMap_["sensitivity"] = sensitivityFileName_;
636 fileNameMap_["sensitivity_scenario"] = sensitivityScenarioFileName_;
637 fileNameMap_["par_sensitivity"] = parSensitivityFileName_;
638 fileNameMap_["jacobi"] = jacobiFileName_;
639 fileNameMap_["jacobi_inverse"] = jacobiInverseFileName_;
641 fileNameMap_["stress_ZeroStressData"] = stressZeroScenarioDataFileName_;
642 fileNameMap_["xva_stress"] = xvaStressTestFileName_;
643 fileNameMap_["var"] = varFileName_;
644 fileNameMap_["parConversionSensitivity"] = parConversionOutputFileName_;
645 fileNameMap_["parConversionJacobi"] = parConversionJacobiFileName_;
646 fileNameMap_["parConversionJacobi_inverse"] = parConversionJacobiInverseFileName_;
648 fileNameMap_["parStress_ZeroStressData"] = parStressTestConversionFile_;
650
651 fileNameMap_["parshifts"] = zeroToParShiftFile_;
652 vector<Size> dimOutputGridPoints;
653 tmp = params->get("xva", "dimOutputGridPoints", false);
654 if (tmp != "")
655 dimOutputGridPoints = parseListOfValues<Size>(tmp, parseInteger);
656 QL_REQUIRE(dimOutputGridPoints.size() == dimRegressionFileNames_.size(),
657 "dim regression output grid points size (" << dimOutputGridPoints.size() << ") "
658 << "and file names size (" << dimRegressionFileNames_.size() << ") do not match");
659 for (Size i = 0; i < dimRegressionFileNames_.size(); ++i)
660 fileNameMap_["dim_regression_" + std::to_string(i)] = dimRegressionFileNames_[i];
661
662 tmp = params->get("xva", "creditMigrationTimeSteps", false);
663 if (tmp != "") {
664 auto ts = parseListOfValues<Size>(tmp, &parseInteger);
665 for (auto const& t : ts) {
666 fileNameMap_["credit_migration_" + std::to_string(t)] =
667 params->get("xva", "creditMigrationOutputFiles") + "_" + std::to_string(t);
668 }
669 }
670
671 LOG("OutputFileNameMap complete");
672}
673
674std::string OutputParameters::outputFileName(const std::string& internalName, const std::string& suffix) {
675 auto it = fileNameMap_.find(internalName);
676 if (it == fileNameMap_.end() || it->second == "")
677 return internalName + "." + suffix;
678 else
679 return it->second; // contains suffix
680}
681
682
684 parConversionSimMarketParams_ = QuantLib::ext::make_shared<ScenarioSimMarketParameters>();
685 parConversionSimMarketParams_->fromXMLString(xml);
686}
687
689 parConversionSimMarketParams_ = QuantLib::ext::make_shared<ScenarioSimMarketParameters>();
690 parConversionSimMarketParams_->fromFile(fileName);
691}
692
694 parConversionScenarioData_ = QuantLib::ext::make_shared<SensitivityScenarioData>();
695 parConversionScenarioData_->fromXMLString(xml);
696}
697
699 parConversionScenarioData_ = QuantLib::ext::make_shared<SensitivityScenarioData>();
700 parConversionScenarioData_->fromFile(fileName);
701}
703 parConversionPricingEngine_ = QuantLib::ext::make_shared<EngineData>();
704 parConversionPricingEngine_->fromXMLString(xml);
705}
706
708 parConversionPricingEngine_ = QuantLib::ext::make_shared<EngineData>();
709 parConversionPricingEngine_->fromFile(fileName);
710}
711
713 parStressSimMarketParams_ = QuantLib::ext::make_shared<ScenarioSimMarketParameters>();
714 parStressSimMarketParams_->fromXMLString(xml);
715}
716
718 parStressSimMarketParams_ = QuantLib::ext::make_shared<ScenarioSimMarketParameters>();
719 parStressSimMarketParams_->fromFile(fileName);
720}
721
722void InputParameters::setParStressScenarioData(const std::string& xml) {
723 parStressScenarioData_ = QuantLib::ext::make_shared<StressTestScenarioData>();
724 parStressScenarioData_->fromXMLString(xml);
725}
726
727void InputParameters::setParStressScenarioDataFromFile(const std::string& fileName) {
728 parStressScenarioData_ = QuantLib::ext::make_shared<StressTestScenarioData>();
729 parStressScenarioData_->fromFile(fileName);
730}
731
733 parStressSensitivityScenarioData_ = boost::make_shared<SensitivityScenarioData>();
734 parStressSensitivityScenarioData_->fromXMLString(xml);
735}
736
738 parStressSensitivityScenarioData_ = boost::make_shared<SensitivityScenarioData>();
739 parStressSensitivityScenarioData_->fromFile(fileName);
740}
741
742void InputParameters::setParStressPricingEngine(const std::string& xml) {
743 parStressPricingEngine_ = QuantLib::ext::make_shared<EngineData>();
744 parStressPricingEngine_->fromXMLString(xml);
745}
746
747void InputParameters::setParStressPricingEngineFromFile(const std::string& fileName) {
748 parStressPricingEngine_ = QuantLib::ext::make_shared<EngineData>();
749 parStressPricingEngine_->fromFile(fileName);
750}
751
753 zeroToParShiftSimMarketParams_ = QuantLib::ext::make_shared<ScenarioSimMarketParameters>();
754 zeroToParShiftSimMarketParams_->fromXMLString(xml);
755}
756
758 zeroToParShiftSimMarketParams_ = QuantLib::ext::make_shared<ScenarioSimMarketParameters>();
759 zeroToParShiftSimMarketParams_->fromFile(fileName);
760}
761
763 zeroToParShiftScenarioData_ = QuantLib::ext::make_shared<StressTestScenarioData>();
764 zeroToParShiftScenarioData_->fromXMLString(xml);
765}
766
768 zeroToParShiftScenarioData_ = QuantLib::ext::make_shared<StressTestScenarioData>();
769 zeroToParShiftScenarioData_->fromFile(fileName);
770}
771
773 zeroToParShiftSensitivityScenarioData_ = boost::make_shared<SensitivityScenarioData>();
774 zeroToParShiftSensitivityScenarioData_->fromXMLString(xml);
775}
776
778 zeroToParShiftSensitivityScenarioData_ = boost::make_shared<SensitivityScenarioData>();
779 zeroToParShiftSensitivityScenarioData_->fromFile(fileName);
780}
781
783 zeroToParShiftPricingEngine_ = QuantLib::ext::make_shared<EngineData>();
784 zeroToParShiftPricingEngine_->fromXMLString(xml);
785}
786
788 zeroToParShiftPricingEngine_ = QuantLib::ext::make_shared<EngineData>();
789 zeroToParShiftPricingEngine_->fromFile(fileName);
790}
791
793 if (mporDate_ == Date()) {
794 QL_REQUIRE(asof() != Date(), "Asof date is required for mpor date");
795 QL_REQUIRE(!mporCalendar().empty(), "MporCalendar or BaseCurrency is required for mpor date");
796 QL_REQUIRE(mporDays() != Null<Size>(), "mporDays is required for mpor date");
797
798 int effectiveMporDays = mporForward()
799 ? static_cast<int>(mporDays())
800 : -static_cast<int>(mporDays());
801
802 mporDate_ = mporCalendar().advance(asof(), effectiveMporDays, QuantExt::Days);
803 }
804 return mporDate_;
805}
806
807QuantLib::ext::shared_ptr<SimmConfiguration> InputParameters::getSimmConfiguration() {
808 QL_REQUIRE(simmBucketMapper() != nullptr,
809 "Internal error, load simm bucket mapper before retrieving simmconfiguration");
811}
812
813
814} // namespace analytics
815} // namespace ore
void setParStressScenarioDataFromFile(const std::string &fileName)
void setStressScenarioData(const std::string &xml)
void setZeroToParShiftPricingEngineFromFile(const std::string &fileName)
void setPortfolio(const std::string &xml)
QuantLib::ext::shared_ptr< ore::data::EngineData > amcPricingEngine_
QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioData > parStressSensitivityScenarioData_
void setSimulationPricingEngineFromFile(const std::string &fileName)
void setSensiScenarioDataFromFile(const std::string &fileName)
void setParStressPricingEngine(const std::string &xml)
void setNettingSetManagerFromFile(const std::string &fileName)
void setStressPricingEngineFromFile(const std::string &fileName)
void setParConversionScenarioData(const std::string &xml)
void setSensitivityStreamFromBuffer(const std::string &buffer)
void setAnalytics(const std::string &s)
QuantLib::ext::shared_ptr< ore::data::TodaysMarketParameters > todaysMarketParams_
void setParStressSimMarketParams(const std::string &xml)
QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > scenarioSimMarketParams_
QuantLib::ext::shared_ptr< ore::analytics::SimmCalibrationData > simmCalibrationData_
void setCubeFromFile(const std::string &file)
QuantLib::ext::shared_ptr< ore::data::EngineData > pricingEngine_
QuantLib::ext::shared_ptr< ore::data::Conventions > conventions_
void setSensiSimMarketParamsFromFile(const std::string &fileName)
QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > stressSimMarketParams_
void setStressPricingEngine(const std::string &xml)
QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioData > xvaSensiScenarioData_
const QuantLib::Calendar mporCalendar()
std::set< std::string > analytics_
std::vector< Period > cvaSensiGrid_
void setXvaStressScenarioData(const std::string &s)
QuantLib::ext::shared_ptr< ore::analytics::StressTestScenarioData > stressScenarioData_
void setParStressSensitivityScenarioData(const std::string &xml)
void setScenarioGeneratorData(const std::string &xml)
QuantLib::ext::shared_ptr< AggregationScenarioData > mktCube_
void setSensiSimMarketParams(const std::string &xml)
void setCollateralBalancesFromFile(const std::string &fileName)
void setCreditSimulationParametersFromBuffer(const std::string &xml)
void setCreditSimulationParametersFromFile(const std::string &fileName)
QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > histVarSimMarketParams_
QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioData > zeroToParShiftSensitivityScenarioData_
std::map< std::string, std::string > marketConfigs_
void setXvaStressSensitivityScenarioDataFromFile(const std::string &fileName)
const QuantLib::ext::shared_ptr< ore::analytics::SimmCalibrationData > & simmCalibrationData() const
void setZeroToParShiftScenarioDataFromFile(const std::string &fileName)
void setRefDataManager(const std::string &xml)
QuantLib::ext::shared_ptr< ore::analytics::StressTestScenarioData > xvaStressScenarioData_
void setSensitivityStreamFromFile(const std::string &fileName)
void setStressSimMarketParamsFromFile(const std::string &fileName)
void setZeroToParShiftSimMarketParams(const std::string &xml)
QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > parStressSimMarketParams_
void setCashflowHorizon(const std::string &s)
void setXvaSensiScenarioData(const std::string &xml)
QuantLib::ext::shared_ptr< ore::data::EngineData > parStressPricingEngine_
void setCurveConfigs(const std::string &xml)
const QuantLib::ext::shared_ptr< ore::analytics::SimmBucketMapper > & simmBucketMapper() const
void setPricingEngineFromFile(const std::string &fileName)
void setBenchmarkVarPeriod(const std::string &period)
QuantLib::ext::shared_ptr< SimmConfiguration > getSimmConfiguration()
void setCovarianceDataFromFile(const std::string &fileName)
void setMarketConfigs(const std::map< std::string, std::string > &m)
void setRefDataManagerFromFile(const std::string &fileName)
void setAmcPricingEngineFromFile(const std::string &fileName)
void setHistVarSimMarketParamsFromFile(const std::string &fileName)
void setParConversionSimMarketParamsFromFile(const std::string &fileName)
void setParConversionScenarioDataFromFile(const std::string &fileName)
void setMarketCubeFromFile(const std::string &file)
void setSimulationPricingEngine(const std::string &xml)
QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioData > xvaStressSensitivityScenarioData_
std::map< std::pair< RiskFactorKey, RiskFactorKey >, Real > covarianceData_
void setParStressSensitivityScenarioDataFromFile(const std::string &fileName)
void setZeroToParShiftSensitivityScenarioData(const std::string &xml)
void setCrossAssetModelData(const std::string &xml)
void setSimmCalibrationDataFromFile(const std::string &fileName)
QuantLib::ext::shared_ptr< ore::data::EngineData > sensiPricingEngine_
void setNettingSetCubeFromFile(const std::string &file)
QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > exposureSimMarketParams_
void setPortfolioFilterDate(const std::string &s)
void setExposureSimMarketParamsFromFile(const std::string &fileName)
QuantLib::Size mporDays() const
QuantLib::ext::shared_ptr< ore::data::EngineData > stressPricingEngine_
void setConventions(const std::string &xml)
QuantLib::ext::shared_ptr< ore::analytics::StressTestScenarioData > zeroToParShiftScenarioData_
QuantLib::ext::shared_ptr< ore::data::BasicReferenceDataManager > refDataManager_
QuantLib::ext::shared_ptr< ore::data::EngineData > zeroToParShiftPricingEngine_
void setZeroToParShiftPricingEngine(const std::string &xml)
QuantLib::ext::shared_ptr< ore::analytics::SimmBasicNameMapper > simmNameMapper_
void setStressSensitivityScenarioData(const std::string &xml)
QuantLib::ext::shared_ptr< ore::data::IborFallbackConfig > iborFallbackConfig_
void setXvaCgSensiScenarioData(const std::string &xml)
QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioData > sensiScenarioData_
void setPricingEngine(const std::string &xml)
void setXvaCgSensiScenarioDataFromFile(const std::string &fileName)
QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioData > stressSensitivityScenarioData_
void setAsOfDate(const std::string &s)
void setStressSensitivityScenarioDataFromFile(const std::string &fileName)
void setAmcPricingEngine(const std::string &xml)
void setParStressPricingEngineFromFile(const std::string &fileName)
void setScriptLibraryFromFile(const std::string &fileName)
const std::string & simmVersion() const
void setSimmNameMapper(const QuantLib::ext::shared_ptr< ore::analytics::SimmBasicNameMapper > &p)
QuantLib::ext::shared_ptr< ore::data::EngineData > simulationPricingEngine_
void setScriptLibrary(const std::string &xml)
void setZeroToParShiftSimMarketParamsFromFile(const std::string &fileName)
QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > xvaStressSimMarketParams_
void setStressSimMarketParams(const std::string &xml)
QuantLib::ext::shared_ptr< ore::analytics::SimmBucketMapper > simmBucketMapper_
QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioData > xvaCgSensiScenarioData_
QuantLib::ext::shared_ptr< ore::data::Portfolio > portfolio_
QuantLib::ext::shared_ptr< ScenarioGeneratorData > scenarioGeneratorData_
void setParStressSimMarketParamsFromFile(const std::string &fileName)
void setZeroToParShiftSensitivityScenarioDataFromFile(const std::string &fileName)
void setXvaSensiPricingEngineFromFile(const std::string &fileName)
void insertAnalytic(const std::string &s)
void setDeterministicInitialMargin(const std::string &n, TimeSeries< Real > v)
void setIborFallbackConfig(const std::string &xml)
QuantLib::ext::shared_ptr< ore::data::EngineData > parConversionPricingEngine_
CurveConfigurationsManager curveConfigs_
void setAmcTradeTypes(const std::string &s)
void setPortfolioFromFile(const std::string &fileNameString, const std::filesystem::path &inputPath)
void setCrifFromFile(const std::string &fileName, char eol='\n', char delim=',', char quoteChar='\0', char escapeChar='\\')
const QuantLib::Date & asof() const
QuantLib::ext::shared_ptr< ore::data::EngineData > xvaSensiPricingEngine_
void setMarketCube(const QuantLib::ext::shared_ptr< AggregationScenarioData > &cube)
void setTodaysMarketParams(const std::string &xml)
void setCrifFromBuffer(const std::string &csvBuffer, char eol='\n', char delim=',', char quoteChar='\0', char escapeChar='\\')
const std::string & reportNaString() const
void setExposureSimMarketParams(const std::string &xml)
QuantLib::ext::shared_ptr< ore::analytics::StressTestScenarioData > parStressScenarioData_
QuantLib::ext::shared_ptr< SensitivityStream > sensitivityStream_
QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > sensiSimMarketParams_
QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > xvaSensiSimMarketParams_
QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > zeroToParShiftSimMarketParams_
void setCollateralBalances(const std::string &xml)
void setXvaSensiPricingEngine(const std::string &xml)
void setSimmNameMapperFromFile(const std::string &fileName)
void setSensiPricingEngine(const std::string &xml)
void setParStressScenarioData(const std::string &xml)
void setXvaStressScenarioDataFromFile(const std::string &s)
QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > parConversionSimMarketParams_
void setMarketConfig(const std::string &config, const std::string &context)
void setCptyCubeFromFile(const std::string &file)
void setMporCalendar(const std::string &s)
QuantLib::ext::shared_ptr< CreditSimulationParameters > creditSimulationParameters_
void setCrossAssetModelDataFromFile(const std::string &fileName)
void setXvaStressSimMarketParamsFromFile(const std::string &f)
void setXvaStressSensitivityScenarioData(const std::string &xml)
void setHistoricalScenarioReader(const std::string &fileName)
QuantLib::ext::shared_ptr< NPVCube > cptyCube_
void setCube(const QuantLib::ext::shared_ptr< NPVCube > &cube)
void setCovarianceDataFromBuffer(const std::string &xml)
void setXvaStressSimMarketParams(const std::string &xml)
void setParConversionPricingEngineFromFile(const std::string &fileName)
QuantLib::ext::shared_ptr< CrossAssetModelData > crossAssetModelData_
void setCurveConfigsFromFile(const std::string &fileName)
void setScenarioSimMarketParams(const std::string &xml)
void setParConversionSimMarketParams(const std::string &xml)
void setZeroToParShiftScenarioData(const std::string &xml)
void setCvaSensiGrid(const std::string &s)
QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioData > parConversionScenarioData_
void setScenarioSimMarketParamsFromFile(const std::string &fileName)
QuantLib::ext::shared_ptr< ore::data::NettingSetManager > nettingSetManager_
void setParConversionPricingEngine(const std::string &xml)
void setSensiScenarioData(const std::string &xml)
void setXvaSensiSimMarketParamsFromFile(const std::string &fileName)
void setTodaysMarketParamsFromFile(const std::string &fileName)
void setIborFallbackConfigFromFile(const std::string &fileName)
void setSimmBucketMapper(const QuantLib::ext::shared_ptr< ore::analytics::SimmBucketMapper > &p)
void setDimRegressors(const std::string &s)
const QuantLib::ext::shared_ptr< NPVCube > & cube() const
void setDimOutputGridPoints(const std::string &s)
QuantLib::ext::shared_ptr< HistoricalScenarioReader > historicalScenarioReader_
void setXvaSensiSimMarketParams(const std::string &xml)
void setDeterministicInitialMarginFromFile(const std::string &fileName)
void setConventionsFromFile(const std::string &fileName)
QuantLib::ext::shared_ptr< ore::data::CollateralBalances > collateralBalances_
void setCovarianceData(ore::data::CSVReader &reader)
QuantLib::ext::shared_ptr< NPVCube > cube_
void setVarQuantiles(const std::string &s)
void setStressScenarioDataFromFile(const std::string &fileName)
void setXvaSensiScenarioDataFromFile(const std::string &fileName)
void setNettingSetManager(const std::string &xml)
void setScenarioGeneratorDataFromFile(const std::string &fileName)
QuantLib::ext::shared_ptr< NPVCube > nettingSetCube_
void setSimmBucketMapperFromFile(const std::string &fileName)
void setSensiPricingEngineFromFile(const std::string &fileName)
std::set< std::string > amcTradeTypes_
std::map< std::string, std::string > fileNameMap_
std::string outputFileName(const std::string &internalName, const std::string &suffix)
std::vector< std::string > dimRegressionFileNames_
OutputParameters(const QuantLib::ext::shared_ptr< Parameters > &params)
std::string get(const std::string &field) const
void add(const QuantLib::ext::shared_ptr< CurveConfigurations > &config, std::string id=std::string())
static IborFallbackConfig defaultConfig()
Class for loading CRIF records.
load / save cubes and agg scen data from / to disk
Calendar parseCalendar(const string &s)
Date parseDate(const string &s)
Period parsePeriod(const string &s)
Real parseReal(const string &s)
Integer parseInteger(const string &s)
Class for reading historical scenarios from file.
A cube implementation that stores the cube in memory.
Input Parameters.
data
#define LOG(text)
#define WLOG(text)
vector< string > getFileNames(const string &fileString, const std::filesystem::path &path)
QuantLib::ext::shared_ptr< AggregationScenarioData > loadAggregationScenarioData(const std::string &filename)
Definition: cube_io.cpp:234
RiskFactorKey parseRiskFactorKey(const string &str)
Definition: scenario.cpp:183
QuantLib::ext::shared_ptr< SimmConfiguration > buildSimmConfiguration(const string &simmVersion, const QuantLib::ext::shared_ptr< SimmBucketMapper > &simmBucketMapper, const QuantLib::ext::shared_ptr< SimmCalibrationData > &simmCalibrationData, const Size &mporDays)
Definition: utilities.cpp:191
NPVCubeWithMetaData loadCube(const std::string &filename, const bool doublePrecision)
Definition: cube_io.cpp:63
std::vector< string > parseListOfValues(string s, const char escape, const char delim, const char quote)
Singleton class to hold global Observation Mode.
Class for streaming SensitivityRecords from file.
Shift scenario generation.
Base SIMM class for mapping qualifiers to buckets.
factory classes for simple scenarios
static std::vector< std::set< std::string > > additionalHeaders
Definition: crifrecord.hpp:369
QuantLib::ext::shared_ptr< NPVCube > cube
Definition: cube_io.hpp:39