101 {
102
103 LOG(
"Scenario analytic called with asof " << io::iso_date(
inputs_->asof()));
104
105 Settings::instance().evaluationDate() =
inputs_->asof();
106
107
108 LOG(
"SCENARIO_STATISTICS: Build Today's Market");
109 CONSOLEW(
"SCENARIO_STATISTICS: Build Market");
112
114
115 LOG(
"SCENARIO_STATISTICS: Build simulation market");
117
118 LOG(
"SCENARIO_STATISTICS: Build Scenario Generator");
119 auto globalParams =
inputs_->simulationPricingEngine()->globalParameters();
120 auto continueOnCalErr = globalParams.find("ContinueOnCalibrationError");
121 bool continueOnErr = (continueOnCalErr != globalParams.end()) &&
parseBool(continueOnCalErr->second);
123
124 LOG(
"SCENARIO_STATISTICS: Attach Scenario Generator to ScenarioSimMarket");
126
128
129
130 const vector<RiskFactorKey>& keys =
simMarket_->baseScenario()->keys();
132 inputs_->scenarioOutputZeroRate()
134 analytic()->configurations().simMarketParams)
136
137 auto statsReport = QuantLib::ext::make_shared<InMemoryReport>();
140 *statsReport);
141 analytic()->
reports()[
"SCENARIO_STATISTICS"][
"scenario_statistics"] = statsReport;
142
143 auto distributionReport = QuantLib::ext::make_shared<InMemoryReport>();
146 inputs_->scenarioDistributionSteps(), *distributionReport);
147 analytic()->
reports()[
"SCENARIO_STATISTICS"][
"scenario_distribution"] = distributionReport;
148}
Analytic * analytic() const
QuantLib::ext::shared_ptr< InputParameters > inputs_
analytic_reports & reports()
Result reports.
Configurations & configurations()
virtual void buildMarket(const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, const bool marketRequired=true)
QuantLib::ext::shared_ptr< ScenarioGenerator > scenarioGenerator()
QuantLib::ext::shared_ptr< ScenarioSimMarket > simMarket_
QuantLib::ext::shared_ptr< ScenarioGenerator > scenarioGenerator_
void buildScenarioSimMarket()
QuantLib::ext::shared_ptr< DateGrid > grid_
void buildScenarioGenerator(bool continueOnError)
bool parseBool(const string &s)
QuantLib::ext::shared_ptr< ore::analytics::ScenarioGeneratorData > scenarioGeneratorData