47 {
48
50 LOG(
"Running sensitivity analysis");
51
52 QuantLib::ext::shared_ptr<ScenarioSimMarketParameters> simMarketData(new ScenarioSimMarketParameters);
53 sensiData_ = QuantLib::ext::make_shared<SensitivityScenarioData>();
54 QuantLib::ext::shared_ptr<EngineData> engineData = QuantLib::ext::make_shared<EngineData>();
55 QuantLib::ext::shared_ptr<Portfolio> sensiPortfolio = QuantLib::ext::make_shared<Portfolio>();
56 string marketConfiguration =
params_->get(
"markets",
"sensitivity");
57
59
60 bool recalibrateModels =
61 params_->has(
"sensitivity",
"recalibrateModels") &&
parseBool(
params_->get(
"sensitivity",
"recalibrateModels"));
62
63 bool analyticFxSensis = false;
64 if (
params_->has(
"sensitivity",
"analyticFxSensis")) {
65 analyticFxSensis =
parseBool(
params_->get(
"sensitivity",
"analyticFxSensis"));
66 }
67
68 QuantLib::ext::shared_ptr<SensitivityAnalysis> sensiAnalysis = QuantLib::ext::make_shared<SensitivityAnalysis>(
69 sensiPortfolio, market, marketConfiguration, engineData, simMarketData,
sensiData_, recalibrateModels,
71 analyticFxSensis);
72 sensiAnalysis->generateSensitivities();
73
75
77
78 LOG(
"Sensitivity analysis completed");
80}
QuantLib::ext::shared_ptr< SensitivityScenarioData > sensiData_
Sensitivity configuration data used for the sensitivity run.
QuantLib::ext::shared_ptr< ScenarioSimMarket > simMarket_
Scenario simulation market that is bumped for the sensitivity run.
virtual void sensiInputInitialize(QuantLib::ext::shared_ptr< ScenarioSimMarketParameters > &simMarketData, QuantLib::ext::shared_ptr< SensitivityScenarioData > &sensiData, QuantLib::ext::shared_ptr< EngineData > &engineData, QuantLib::ext::shared_ptr< Portfolio > &sensiPortfolio)
Initialize input parameters to the sensitivities analysis.
virtual void sensiOutputReports(const QuantLib::ext::shared_ptr< SensitivityAnalysis > &sensiAnalysis)
Write out some standard sensitivities reports.
bool parseBool(const string &s)