Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Namespaces | Functions
parsensitivityanalysis.cpp File Reference
#include "parsensitivityanalysis.hpp"
#include "testmarket.hpp"
#include "testportfolio.hpp"
#include <orea/cube/inmemorycube.hpp>
#include <orea/cube/npvcube.hpp>
#include <orea/engine/observationmode.hpp>
#include <orea/engine/parsensitivityanalysis.hpp>
#include <orea/engine/sensitivityanalysis.hpp>
#include <orea/engine/valuationcalculator.hpp>
#include <orea/engine/valuationengine.hpp>
#include <orea/engine/zerotoparcube.hpp>
#include <orea/scenario/deltascenariofactory.hpp>
#include <orea/scenario/scenariosimmarket.hpp>
#include <orea/scenario/scenariosimmarketparameters.hpp>
#include <orea/scenario/sensitivityscenariodata.hpp>
#include <orea/scenario/sensitivityscenariogenerator.hpp>
#include <ored/model/lgmdata.hpp>
#include <ored/portfolio/builders/bond.hpp>
#include <ored/portfolio/builders/capfloor.hpp>
#include <ored/portfolio/builders/fxforward.hpp>
#include <ored/portfolio/builders/fxoption.hpp>
#include <ored/portfolio/builders/swap.hpp>
#include <ored/portfolio/builders/swaption.hpp>
#include <ored/portfolio/builders/yoycapfloor.hpp>
#include <ored/portfolio/portfolio.hpp>
#include <ored/portfolio/swap.hpp>
#include <ored/portfolio/swaption.hpp>
#include <ored/utilities/dategrid.hpp>
#include <ored/utilities/log.hpp>
#include <ored/utilities/osutils.hpp>
#include <ored/utilities/to_string.hpp>
#include <ql/termstructures/yield/piecewiseyieldcurve.hpp>
#include <ql/time/calendars/target.hpp>
#include <ql/time/date.hpp>
#include <ql/time/daycounters/actualactual.hpp>
#include <test/oreatoplevelfixture.hpp>
#include <boost/timer/timer.hpp>

Go to the source code of this file.

Namespaces

namespace  testsuite
 

Functions

QuantLib::ext::shared_ptr< analytics::ScenarioSimMarketParameterssetupSimMarketData2 ()
 
QuantLib::ext::shared_ptr< analytics::ScenarioSimMarketParameterssetupSimMarketData5 ()
 
SensitivityScenarioData::CurveShiftParData createCurveShiftData ()
 
QuantLib::ext::shared_ptr< SensitivityScenarioDatasetupSensitivityScenarioData2 ()
 
QuantLib::ext::shared_ptr< SensitivityScenarioDatasetupSensitivityScenarioData5 (bool parConversion)
 
void testParConversion (ObservationMode::Mode om)
 
 BOOST_AUTO_TEST_CASE (ZeroShifts1d)
 
 BOOST_AUTO_TEST_CASE (ZeroShifts2d)
 
 BOOST_AUTO_TEST_CASE (ZeroSensitivity)
 
 BOOST_AUTO_TEST_CASE (ParConversionNoneObs)
 
 BOOST_AUTO_TEST_CASE (ParConversionDisableObs)
 
 BOOST_AUTO_TEST_CASE (ParConversionDeferObs)
 
 BOOST_AUTO_TEST_CASE (ParConversionUnregisterObs)
 

Function Documentation

◆ setupSimMarketData2()

QuantLib::ext::shared_ptr< analytics::ScenarioSimMarketParameters > setupSimMarketData2 ( )

Definition at line 70 of file parsensitivityanalysis.cpp.

70 {
71 QuantLib::ext::shared_ptr<analytics::ScenarioSimMarketParameters> simMarketData(
73 simMarketData->baseCcy() = "EUR";
74 simMarketData->ccys() = {"EUR", "GBP", "USD"};
75 simMarketData->setDiscountCurveNames({"EUR", "GBP", "USD"});
76 simMarketData->setYieldCurveTenors("", {1 * Months, 6 * Months, 1 * Years, 2 * Years, 3 * Years, 4 * Years,
77 5 * Years, 6 * Years, 7 * Years, 8 * Years, 9 * Years, 10 * Years,
78 12 * Years, 15 * Years, 20 * Years, 25 * Years, 30 * Years});
79 simMarketData->setIndices({"EUR-EURIBOR-6M", "GBP-LIBOR-6M"});
80 simMarketData->interpolation() = "LogLinear";
81
82 simMarketData->setDefaultNames({"BondIssuer1"});
83
84 simMarketData->setDefaultTenors(
85 "", {6 * Months, 1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years});
86 simMarketData->setSimulateSurvivalProbabilities(true);
87 simMarketData->setDefaultCurveCalendars("", "TARGET");
88
89 simMarketData->setSwapVolTerms(
90 "", {1 * Years, 2 * Years, 3 * Years, 4 * Years, 5 * Years, 7 * Years, 10 * Years, 20 * Years});
91 simMarketData->setSwapVolExpiries(
92 "", {6 * Months, 1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 20 * Years});
93 simMarketData->setSwapVolKeys({"EUR", "GBP"});
94 simMarketData->swapVolDecayMode() = "ForwardVariance";
95 simMarketData->setSimulateSwapVols(true);
96
97 simMarketData->setFxVolExpiries("",
98 vector<Period>{1 * Months, 3 * Months, 6 * Months, 2 * Years, 3 * Years, 4 * Years, 5 * Years});
99 simMarketData->setFxVolDecayMode(string("ConstantVariance"));
100 simMarketData->setSimulateFXVols(true);
101 simMarketData->setFxVolCcyPairs({"EURGBP"});
102 simMarketData->setFxVolIsSurface(true);
103 simMarketData->setFxVolMoneyness(vector<Real>{0.1, 0.5, 1, 1.5, 2, 2.5, 2});
104
105 simMarketData->setFxCcyPairs({"EURGBP"});
106
107 simMarketData->setSimulateCapFloorVols(false);
108 simMarketData->setEquityNames({"SP5", "Lufthansa"});
109 simMarketData->setEquityDividendTenors("SP5", {6 * Months, 1 * Years, 2 * Years});
110 simMarketData->setEquityDividendTenors("Lufthansa", {6 * Months, 1 * Years, 2 * Years});
111
112 simMarketData->setSimulateEquityVols(true);
113 simMarketData->setEquityVolDecayMode("ForwardVariance");
114 simMarketData->setEquityVolNames({"SP5", "Lufthansa"});
115 simMarketData->setEquityVolExpiries("", {2 * Weeks, 1 * Months, 3 * Months, 6 * Months, 1 * Years,
116 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years,
117 13 * Years, 15 * Years, 20 * Years, 30 * Years});
118 simMarketData->setEquityVolIsSurface("", true);
119 simMarketData->setEquityVolMoneyness("", {0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 1.0, 1.05, 1.1, 1.2,
120 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.5, 3.0});
121
122 simMarketData->setYoyInflationIndices({"UKRP1"});
123 simMarketData->setYoyInflationTenors(
124 "UKRP1", {1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years});
125
126 simMarketData->setSimulateYoYInflationCapFloorVols(true);
127 simMarketData->setYoYInflationCapFloorVolNames({"UKRP1"});
128 simMarketData->setYoYInflationCapFloorVolExpiries(
129 "UKRP1", {1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years});
130 simMarketData->setYoYInflationCapFloorVolStrikes("", {-0.02, -0.01, 0.00, 0.01, 0.02, 0.03});
131 simMarketData->yoyInflationCapFloorVolDecayMode() = "ForwardVariance";
132
133 return simMarketData;
134}
+ Here is the caller graph for this function:

◆ setupSimMarketData5()

QuantLib::ext::shared_ptr< analytics::ScenarioSimMarketParameters > setupSimMarketData5 ( )

Definition at line 136 of file parsensitivityanalysis.cpp.

136 {
137 QuantLib::ext::shared_ptr<analytics::ScenarioSimMarketParameters> simMarketData(
139
140 simMarketData->baseCcy() = "EUR";
141
142 simMarketData->setDiscountCurveNames({"EUR", "GBP", "USD", "CHF", "JPY"});
143 simMarketData->setYieldCurveNames({"BondCurve1"});
144 simMarketData->yieldCurveCurrencies()["BondCurve1"] = "EUR";
145 simMarketData->setYieldCurveTenors("", {1 * Months, 6 * Months, 1 * Years, 2 * Years, 3 * Years, 4 * Years,
146 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years, 30 * Years});
147 simMarketData->setIndices(
148 {"EUR-EURIBOR-6M", "USD-LIBOR-3M", "USD-LIBOR-6M", "GBP-LIBOR-6M", "CHF-LIBOR-6M", "JPY-LIBOR-6M"});
149 simMarketData->interpolation() = "LogLinear";
150
151 simMarketData->setDefaultNames({"BondIssuer1", "dc"});
152 simMarketData->setDefaultTenors(
153 "", {6 * Months, 1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years});
154 simMarketData->setSimulateSurvivalProbabilities(true);
155 simMarketData->setSecurities({"Bond1"});
156 simMarketData->setDefaultCurveCalendars("", "TARGET");
157
158 simMarketData->setSwapVolTerms("", {1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 20 * Years});
159 simMarketData->setSwapVolExpiries(
160 "", {6 * Months, 1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 20 * Years});
161 simMarketData->setSwapVolKeys({"EUR", "GBP", "USD", "CHF", "JPY"});
162 simMarketData->swapVolDecayMode() = "ForwardVariance";
163 simMarketData->setSimulateSwapVols(true); // false;
164
165 simMarketData->setFxVolExpiries("",
166 vector<Period>{1 * Months, 3 * Months, 6 * Months, 2 * Years, 3 * Years, 4 * Years, 5 * Years});
167 simMarketData->setFxVolDecayMode(string("ConstantVariance"));
168 simMarketData->setSimulateFXVols(true); // false;
169 simMarketData->setFxVolCcyPairs({"EURUSD", "EURGBP", "EURCHF", "EURJPY"});
170 simMarketData->setFxVolIsSurface(true);
171 simMarketData->setFxVolMoneyness(vector<Real>{0.1, 0.5, 1, 1.5, 2, 2.5, 3});
172
173 simMarketData->setFxCcyPairs({"EURUSD", "EURGBP", "EURCHF", "EURJPY"});
174
175 simMarketData->setSimulateCapFloorVols(true);
176 simMarketData->capFloorVolDecayMode() = "ForwardVariance";
177 simMarketData->setCapFloorVolKeys({"EUR", "USD"});
178 simMarketData->setCapFloorVolExpiries(
179 "", {6 * Months, 1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years});
180 simMarketData->setCapFloorVolStrikes("", {0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06});
181
182 simMarketData->setSimulateCdsVols(true);
183 simMarketData->cdsVolExpiries() = {6 * Months, 1 * Years, 2 * Years, 3 * Years, 5 * Years, 10 * Years};
184 simMarketData->cdsVolDecayMode() = "ForwardVariance";
185 simMarketData->setCdsVolNames({"dc"});
186
187 simMarketData->setEquityNames({"SP5", "Lufthansa"});
188 simMarketData->setEquityDividendTenors("SP5", {6 * Months, 1 * Years, 2 * Years});
189 simMarketData->setEquityDividendTenors("Lufthansa", {6 * Months, 1 * Years, 2 * Years});
190
191 simMarketData->setSimulateEquityVols(true);
192 simMarketData->setEquityVolDecayMode("ForwardVariance");
193 simMarketData->setEquityVolNames({"SP5", "Lufthansa"});
194 simMarketData->setEquityVolExpiries("", {2 * Weeks, 1 * Months, 3 * Months, 6 * Months, 1 * Years,
195 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years,
196 13 * Years, 15 * Years, 20 * Years, 30 * Years});
197 simMarketData->setEquityVolIsSurface("", true);
198 simMarketData->setEquityVolMoneyness("", {0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 1.0, 1.05, 1.1, 1.2,
199 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.5, 3.0});
200
201 simMarketData->setYoyInflationIndices({"UKRP1"});
202 simMarketData->setYoyInflationTenors(
203 "UKRP1", {1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years});
204
205 simMarketData->setSimulateYoYInflationCapFloorVols(true);
206 simMarketData->setYoYInflationCapFloorVolNames({"UKRP1"});
207 simMarketData->setYoYInflationCapFloorVolExpiries(
208 "UKRP1", {1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years});
209 simMarketData->setYoYInflationCapFloorVolStrikes("", {-0.02, -0.01, 0.00, 0.01, 0.02, 0.03});
210 simMarketData->yoyInflationCapFloorVolDecayMode() = "ForwardVariance";
211
212 return simMarketData;
213}
+ Here is the caller graph for this function:

◆ createCurveShiftData()

Definition at line 215 of file parsensitivityanalysis.cpp.

215 {
217 cvsData.shiftTenors = {6 * Months, 1 * Years, 2 * Years, 3 * Years, 5 * Years,
218 7 * Years, 10 * Years, 15 * Years, 20 * Years}; // multiple tenors: triangular shifts
219 cvsData.shiftType = ShiftType::Absolute;
220 cvsData.shiftSize = 0.0001;
221 cvsData.parInstruments = {"DEP", "IRS", "IRS", "IRS", "IRS", "IRS", "IRS", "IRS", "IRS"};
222
223 return cvsData;
224}
+ Here is the caller graph for this function:

◆ setupSensitivityScenarioData2()

QuantLib::ext::shared_ptr< SensitivityScenarioData > setupSensitivityScenarioData2 ( )

Definition at line 225 of file parsensitivityanalysis.cpp.

225 {
226 QuantLib::ext::shared_ptr<SensitivityScenarioData> sensiData = QuantLib::ext::make_shared<SensitivityScenarioData>(false);
227
229 fxsData.shiftType = ShiftType::Relative;
230 fxsData.shiftSize = 0.01;
231
233 fxvsData.shiftType = ShiftType::Relative;
234 fxvsData.shiftSize = 1.0;
235 fxvsData.shiftExpiries = {2 * Years, 5 * Years};
236
238 cfvsData.shiftType = ShiftType::Absolute;
239 cfvsData.shiftSize = 0.0001;
240 cfvsData.shiftExpiries = {1 * Years, 2 * Years, 3 * Years, 5 * Years, 10 * Years};
241 cfvsData.shiftStrikes = {0.05};
242
244 swvsData.shiftType = ShiftType::Relative;
245 swvsData.shiftSize = 0.01;
246 swvsData.shiftExpiries = {3 * Years, 5 * Years, 10 * Years};
247 swvsData.shiftTerms = {2 * Years, 5 * Years, 10 * Years};
248
250 eurDiscountData.parInstrumentSingleCurve = true;
251 eurDiscountData.parInstrumentConventions["DEP"] = "EUR-DEP-CONVENTIONS";
252 eurDiscountData.parInstrumentConventions["IRS"] = "EUR-6M-SWAP-CONVENTIONS";
253 sensiData->discountCurveShiftData()["EUR"] =
254 QuantLib::ext::make_shared<SensitivityScenarioData::CurveShiftParData>(eurDiscountData);
255
257 gbpDiscountData.parInstrumentSingleCurve = true;
258 gbpDiscountData.parInstrumentConventions["DEP"] = "GBP-DEP-CONVENTIONS";
259 gbpDiscountData.parInstrumentConventions["IRS"] = "GBP-6M-SWAP-CONVENTIONS";
260 sensiData->discountCurveShiftData()["GBP"] =
261 QuantLib::ext::make_shared<SensitivityScenarioData::CurveShiftParData>(gbpDiscountData);
262
264 eurIndexData.parInstrumentSingleCurve = false;
265 eurIndexData.parInstrumentConventions["DEP"] = "EUR-DEP-CONVENTIONS";
266 eurIndexData.parInstrumentConventions["IRS"] = "EUR-6M-SWAP-CONVENTIONS";
267 sensiData->indexCurveShiftData()["EUR-EURIBOR-6M"] =
268 QuantLib::ext::make_shared<SensitivityScenarioData::CurveShiftParData>(eurIndexData);
269
271 gbpIndexData.parInstrumentSingleCurve = false;
272 gbpIndexData.parInstrumentConventions["DEP"] = "GBP-DEP-CONVENTIONS";
273 gbpIndexData.parInstrumentConventions["IRS"] = "GBP-6M-SWAP-CONVENTIONS";
274 sensiData->indexCurveShiftData()["GBP-LIBOR-6M"] =
275 QuantLib::ext::make_shared<SensitivityScenarioData::CurveShiftParData>(gbpIndexData);
276
277 sensiData->fxShiftData()["EURGBP"] = fxsData;
278
279 sensiData->fxVolShiftData()["EURGBP"] = fxvsData;
280
281 sensiData->swaptionVolShiftData()["EUR"] = swvsData;
282 sensiData->swaptionVolShiftData()["GBP"] = swvsData;
283
284 sensiData->creditCcys()["BondIssuer1"] = "EUR";
286 bondData.parInstruments = {"CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS"};
287 bondData.parInstrumentSingleCurve = false;
288 bondData.parInstrumentConventions["CDS"] = "CDS-STANDARD-CONVENTIONS";
289 sensiData->creditCurveShiftData()["BondIssuer1"] =
290 QuantLib::ext::make_shared<SensitivityScenarioData::CurveShiftParData>(bondData);
291
293 eqsData.shiftType = ShiftType::Relative;
294 eqsData.shiftSize = 0.01;
295
297 eqvsData.shiftType = ShiftType::Relative;
298 eqvsData.shiftSize = 0.01;
299 eqvsData.shiftExpiries = {2 * Weeks, 1 * Months, 3 * Months, 6 * Months, 1 * Years, 2 * Years, 3 * Years,
300 5 * Years, 7 * Years, 10 * Years, 13 * Years, 15 * Years, 20 * Years, 30 * Years};
301
303 eqdivData.shiftType = ShiftType::Absolute;
304 eqdivData.shiftSize = 0.00001;
305 eqdivData.shiftTenors = {6 * Months, 1 * Years, 2 * Years};
306
307 sensiData->equityShiftData()["SP5"] = eqsData;
308 sensiData->equityShiftData()["Lufthansa"] = eqsData;
309
310 sensiData->equityVolShiftData()["SP5"] = eqvsData;
311 sensiData->equityVolShiftData()["Lufthansa"] = eqvsData;
312
313 QuantLib::ext::shared_ptr<ore::analytics::SensitivityScenarioData::CurveShiftParData> yinfData =
314 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>();
315 yinfData->shiftType = ShiftType::Absolute;
316 yinfData->shiftSize = 0.0001;
317 yinfData->shiftTenors = {1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years};
318 yinfData->parInstruments = {"YYS", "YYS", "YYS", "YYS", "YYS", "YYS", "YYS", "YYS"};
319 yinfData->parInstrumentConventions["ZIS"] = "UKRP1";
320 yinfData->parInstrumentConventions["YYS"] = "UKRP1";
321 sensiData->yoyInflationCurveShiftData()["UKRP1"] = yinfData;
322
323 auto yinfCfData = QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CapFloorVolShiftParData>();
324 yinfCfData->shiftType = ShiftType::Absolute;
325 yinfCfData->shiftSize = 0.00001;
326 yinfCfData->shiftExpiries = {1 * Years, 2 * Years, 3 * Years, 5 * Years,
327 7 * Years, 10 * Years, 15 * Years, 20 * Years};
328 yinfCfData->shiftStrikes = {-0.02, -0.01, 0.00, 0.01, 0.02, 0.03};
329 yinfCfData->parInstruments = {"YYS", "YYS", "YYS", "YYS", "YYS", "YYS", "YYS", "YYS"};
330 yinfCfData->parInstrumentSingleCurve = false;
331 yinfCfData->parInstrumentConventions["ZIS"] = "UKRP1";
332 yinfCfData->parInstrumentConventions["YYS"] = "UKRP1";
333 sensiData->yoyInflationCapFloorVolShiftData()["UKRP1"] = yinfCfData;
334
335 return sensiData;
336}
SensitivityScenarioData::CurveShiftParData createCurveShiftData()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setupSensitivityScenarioData5()

QuantLib::ext::shared_ptr< SensitivityScenarioData > setupSensitivityScenarioData5 ( bool  parConversion)

Definition at line 338 of file parsensitivityanalysis.cpp.

338 {
339 QuantLib::ext::shared_ptr<SensitivityScenarioData> sensiData =
340 QuantLib::ext::make_shared<SensitivityScenarioData>(parConversion);
341
343
344 fxsData.shiftType = ShiftType::Relative;
345 fxsData.shiftSize = 0.01;
346
348 fxvsData.shiftType = ShiftType::Relative;
349 fxvsData.shiftSize = 1.0;
350 fxvsData.shiftExpiries = {5 * Years};
351
353 cfvsData.shiftType = ShiftType::Absolute;
354 cfvsData.shiftSize = 0.0001;
355 cfvsData.shiftExpiries = {1 * Years, 2 * Years, 3 * Years, 5 * Years, 10 * Years};
356 cfvsData.shiftStrikes = {0.01, 0.02, 0.03, 0.04, 0.05};
357
359 swvsData.shiftType = ShiftType::Relative;
360 swvsData.shiftSize = 0.01;
361 swvsData.shiftExpiries = {2 * Years, 5 * Years, 10 * Years};
362 swvsData.shiftTerms = {5 * Years, 10 * Years};
363
365 cdsvsData.shiftType = ShiftType::Relative;
366 cdsvsData.shiftSize = 0.01;
367 cdsvsData.shiftExpiries = {6 * Months, 1 * Years, 2 * Years, 3 * Years, 5 * Years, 10 * Years};
368
369 // sensiData->creditCurveShiftData()["dc"] = cvsData;
370
372 eurDiscountData.parInstrumentSingleCurve = true;
373 eurDiscountData.parInstrumentConventions["DEP"] = "EUR-DEP-CONVENTIONS";
374 eurDiscountData.parInstrumentConventions["IRS"] = "EUR-6M-SWAP-CONVENTIONS";
375 sensiData->discountCurveShiftData()["EUR"] =
376 QuantLib::ext::make_shared<SensitivityScenarioData::CurveShiftParData>(eurDiscountData);
377
379 usdDiscountData.parInstrumentSingleCurve = true;
380 usdDiscountData.parInstrumentConventions["DEP"] = "USD-DEP-CONVENTIONS";
381 usdDiscountData.parInstrumentConventions["IRS"] = "USD-3M-SWAP-CONVENTIONS";
382 sensiData->discountCurveShiftData()["USD"] =
383 QuantLib::ext::make_shared<SensitivityScenarioData::CurveShiftParData>(usdDiscountData);
384
386 gbpDiscountData.parInstrumentSingleCurve = true;
387 gbpDiscountData.parInstrumentConventions["DEP"] = "GBP-DEP-CONVENTIONS";
388 gbpDiscountData.parInstrumentConventions["IRS"] = "GBP-6M-SWAP-CONVENTIONS";
389 sensiData->discountCurveShiftData()["GBP"] =
390 QuantLib::ext::make_shared<SensitivityScenarioData::CurveShiftParData>(gbpDiscountData);
391
393 jpyDiscountData.parInstrumentSingleCurve = true;
394 jpyDiscountData.parInstrumentConventions["DEP"] = "JPY-DEP-CONVENTIONS";
395 jpyDiscountData.parInstrumentConventions["IRS"] = "JPY-6M-SWAP-CONVENTIONS";
396 sensiData->discountCurveShiftData()["JPY"] =
397 QuantLib::ext::make_shared<SensitivityScenarioData::CurveShiftParData>(jpyDiscountData);
398
400 chfDiscountData.parInstrumentSingleCurve = true;
401 chfDiscountData.parInstrumentConventions["DEP"] = "CHF-DEP-CONVENTIONS";
402 chfDiscountData.parInstrumentConventions["IRS"] = "CHF-6M-SWAP-CONVENTIONS";
403 sensiData->discountCurveShiftData()["CHF"] =
404 QuantLib::ext::make_shared<SensitivityScenarioData::CurveShiftParData>(chfDiscountData);
405
407 bondData.parInstrumentSingleCurve = true;
408 bondData.parInstrumentConventions["DEP"] = "EUR-DEP-CONVENTIONS";
409 bondData.parInstrumentConventions["IRS"] = "EUR-6M-SWAP-CONVENTIONS";
410 sensiData->yieldCurveShiftData()["BondCurve1"] =
411 QuantLib::ext::make_shared<SensitivityScenarioData::CurveShiftParData>(bondData);
412
414 eurIndexData.parInstrumentSingleCurve = false;
415 eurIndexData.parInstrumentConventions["DEP"] = "EUR-DEP-CONVENTIONS";
416 eurIndexData.parInstrumentConventions["IRS"] = "EUR-6M-SWAP-CONVENTIONS";
417 sensiData->indexCurveShiftData()["EUR-EURIBOR-6M"] =
418 QuantLib::ext::make_shared<SensitivityScenarioData::CurveShiftParData>(eurIndexData);
419
421 usdIndexData.parInstrumentSingleCurve = false;
422 usdIndexData.parInstrumentConventions["DEP"] = "USD-DEP-CONVENTIONS";
423 usdIndexData.parInstrumentConventions["IRS"] = "USD-3M-SWAP-CONVENTIONS";
424 sensiData->indexCurveShiftData()["USD-LIBOR-3M"] =
425 QuantLib::ext::make_shared<SensitivityScenarioData::CurveShiftParData>(usdIndexData);
426
428 gbpIndexData.parInstrumentSingleCurve = false;
429 gbpIndexData.parInstrumentConventions["DEP"] = "GBP-DEP-CONVENTIONS";
430 gbpIndexData.parInstrumentConventions["IRS"] = "GBP-6M-SWAP-CONVENTIONS";
431 sensiData->indexCurveShiftData()["GBP-LIBOR-6M"] =
432 QuantLib::ext::make_shared<SensitivityScenarioData::CurveShiftParData>(gbpIndexData);
433
435 jpyIndexData.parInstrumentSingleCurve = false;
436 jpyIndexData.parInstrumentConventions["DEP"] = "JPY-DEP-CONVENTIONS";
437 jpyIndexData.parInstrumentConventions["IRS"] = "JPY-6M-SWAP-CONVENTIONS";
438 sensiData->indexCurveShiftData()["JPY-LIBOR-6M"] =
439 QuantLib::ext::make_shared<SensitivityScenarioData::CurveShiftParData>(jpyIndexData);
440
442 chfIndexData.parInstrumentSingleCurve = false;
443 chfIndexData.parInstrumentConventions["DEP"] = "CHF-DEP-CONVENTIONS";
444 chfIndexData.parInstrumentConventions["IRS"] = "CHF-6M-SWAP-CONVENTIONS";
445 sensiData->indexCurveShiftData()["CHF-LIBOR-6M"] =
446 QuantLib::ext::make_shared<SensitivityScenarioData::CurveShiftParData>(chfIndexData);
447
448 sensiData->fxShiftData()["EURUSD"] = fxsData;
449 sensiData->fxShiftData()["EURGBP"] = fxsData;
450 sensiData->fxShiftData()["EURJPY"] = fxsData;
451 sensiData->fxShiftData()["EURCHF"] = fxsData;
452
453 sensiData->fxVolShiftData()["EURUSD"] = fxvsData;
454 sensiData->fxVolShiftData()["EURGBP"] = fxvsData;
455 sensiData->fxVolShiftData()["EURJPY"] = fxvsData;
456 sensiData->fxVolShiftData()["EURCHF"] = fxvsData;
457
458 sensiData->swaptionVolShiftData()["EUR"] = swvsData;
459 sensiData->swaptionVolShiftData()["GBP"] = swvsData;
460 sensiData->swaptionVolShiftData()["USD"] = swvsData;
461 sensiData->swaptionVolShiftData()["JPY"] = swvsData;
462 sensiData->swaptionVolShiftData()["CHF"] = swvsData;
463
464 sensiData->capFloorVolShiftData()["EUR"] =
465 QuantLib::ext::make_shared<SensitivityScenarioData::CapFloorVolShiftData>(cfvsData);
466 sensiData->capFloorVolShiftData()["EUR"]->indexName = "EUR-EURIBOR-6M";
467 sensiData->capFloorVolShiftData()["USD"] =
468 QuantLib::ext::make_shared<SensitivityScenarioData::CapFloorVolShiftData>(cfvsData);
469 sensiData->capFloorVolShiftData()["USD"]->indexName = "USD-LIBOR-3M";
470
472 dcData.parInstruments = {"CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS"};
473 dcData.parInstrumentSingleCurve = false;
474 dcData.parInstrumentConventions["CDS"] = "CDS-STANDARD-CONVENTIONS";
475 sensiData->creditCurveShiftData()["dc"] =
476 QuantLib::ext::make_shared<SensitivityScenarioData::CurveShiftParData>(dcData);
477 sensiData->creditCcys()["dc"] = "EUR";
478
480 bondIssData.parInstruments = {"CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS"};
481 bondIssData.parInstrumentSingleCurve = false;
482 bondIssData.parInstrumentConventions["CDS"] = "CDS-STANDARD-CONVENTIONS";
483 sensiData->creditCurveShiftData()["BondIssuer1"] =
484 QuantLib::ext::make_shared<SensitivityScenarioData::CurveShiftParData>(bondIssData);
485 sensiData->creditCcys()["BondIssuer1"] = "EUR";
486
487 sensiData->cdsVolShiftData()["dc"] = cdsvsData;
488
490 eqsData.shiftType = ShiftType::Relative;
491 eqsData.shiftSize = 0.01;
492
494 eqvsData.shiftType = ShiftType::Relative;
495 eqvsData.shiftSize = 0.01;
496 eqvsData.shiftExpiries = {2 * Weeks, 1 * Months, 3 * Months, 6 * Months, 1 * Years, 2 * Years, 3 * Years,
497 5 * Years, 10 * Years, 13 * Years, 15 * Years, 20 * Years, 30 * Years};
498
500 eqdivData.shiftType = ShiftType::Absolute;
501 eqdivData.shiftSize = 0.00001;
502 eqdivData.shiftTenors = {6 * Months, 1 * Years, 2 * Years};
503
504 sensiData->equityShiftData()["SP5"] = eqsData;
505 sensiData->equityShiftData()["Lufthansa"] = eqsData;
506
507 sensiData->equityVolShiftData()["SP5"] = eqvsData;
508 sensiData->equityVolShiftData()["Lufthansa"] = eqvsData;
509
510 QuantLib::ext::shared_ptr<ore::analytics::SensitivityScenarioData::CurveShiftParData> yinfData =
511 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>();
512 yinfData->shiftType = ShiftType::Absolute;
513 yinfData->shiftSize = 0.0001;
514 yinfData->shiftTenors = {1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years};
515 yinfData->parInstruments = {"YYS", "YYS", "YYS", "YYS", "YYS", "YYS", "YYS", "YYS"};
516 yinfData->parInstrumentConventions["ZIS"] = "UKRP1";
517 yinfData->parInstrumentConventions["YYS"] = "UKRP1";
518 sensiData->yoyInflationCurveShiftData()["UKRP1"] = yinfData;
519
520 auto yinfCfData = QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CapFloorVolShiftParData>();
521 yinfCfData->shiftType = ShiftType::Absolute;
522 yinfCfData->shiftSize = 0.00001;
523 yinfCfData->shiftExpiries = {1 * Years, 2 * Years, 3 * Years, 5 * Years,
524 7 * Years, 10 * Years, 15 * Years, 20 * Years};
525 yinfCfData->shiftStrikes = {-0.02, -0.01, 0.00, 0.01, 0.02, 0.03};
526 yinfCfData->parInstruments = {"YYS", "YYS", "YYS", "YYS", "YYS", "YYS", "YYS", "YYS"};
527 yinfCfData->parInstrumentSingleCurve = false;
528 yinfCfData->parInstrumentConventions["ZIS"] = "UKRP1";
529 yinfCfData->parInstrumentConventions["YYS"] = "UKRP1";
530 sensiData->yoyInflationCapFloorVolShiftData()["UKRP1"] = yinfCfData;
531
532 return sensiData;
533}
+ Here is the call graph for this function:
+ Here is the caller graph for this function: