Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
simmconfigurationisdav2_5.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 <ql/math/matrix.hpp>
22
23#include <boost/algorithm/string/predicate.hpp>
24#include <boost/make_shared.hpp>
25
26using QuantLib::InterestRateIndex;
27using QuantLib::Matrix;
28using QuantLib::Real;
29using std::string;
30using std::vector;
31
32namespace ore {
33namespace analytics {
34
36
37QuantLib::Size SimmConfiguration_ISDA_V2_5::group(const string& qualifier, const std::map<QuantLib::Size,
38 std::set<string>>& categories) const {
39 QuantLib::Size result = 0;
40 for (const auto& kv : categories) {
41 if (kv.second.empty()) {
42 result = kv.first;
43 } else {
44 if (kv.second.count(qualifier) > 0) {
45 // Found qualifier in category so return it
46 return kv.first;
47 }
48 }
49 }
50
51 // If we get here, result should hold category with empty set
52 return result;
53}
54
55QuantLib::Real SimmConfiguration_ISDA_V2_5::weight(const RiskType& rt, boost::optional<string> qualifier,
56 boost::optional<std::string> label_1,
57 const std::string& calculationCurrency) const {
58
59 if (rt == RiskType::FX) {
60 QL_REQUIRE(calculationCurrency != "", "no calculation currency provided weight");
61 QL_REQUIRE(qualifier, "need a qualifier to return a risk weight for the risk type FX");
62
63 QuantLib::Size g1 = group(calculationCurrency, ccyGroups_);
64 QuantLib::Size g2 = group(*qualifier, ccyGroups_);
65 return rwFX_[g1][g2];
66 }
67
68 return SimmConfigurationBase::weight(rt, qualifier, label_1);
69}
70
71QuantLib::Real SimmConfiguration_ISDA_V2_5::correlation(const RiskType& firstRt, const string& firstQualifier,
72 const string& firstLabel_1, const string& firstLabel_2,
73 const RiskType& secondRt, const string& secondQualifier,
74 const string& secondLabel_1, const string& secondLabel_2,
75 const std::string& calculationCurrency) const {
76
77 if (firstRt == RiskType::FX && secondRt == RiskType::FX) {
78 QL_REQUIRE(calculationCurrency != "", "no calculation currency provided corr");
79 QuantLib::Size g = group(calculationCurrency, ccyGroups_);
80 QuantLib::Size g1 = group(firstQualifier, ccyGroups_);
81 QuantLib::Size g2 = group(secondQualifier, ccyGroups_);
82 if (g == 0) {
83 return fxRegVolCorrelation_[g1][g2];
84 } else if (g == 1) {
85 return fxHighVolCorrelation_[g1][g2];
86 } else {
87 QL_FAIL("FX Volatility group " << g << " not recognized");
88 }
89 }
90
91 return SimmConfigurationBase::correlation(firstRt, firstQualifier, firstLabel_1, firstLabel_2, secondRt,
92 secondQualifier, secondLabel_1, secondLabel_2);
93}
94
95SimmConfiguration_ISDA_V2_5::SimmConfiguration_ISDA_V2_5(const QuantLib::ext::shared_ptr<SimmBucketMapper>& simmBucketMapper,
96 const QuantLib::Size& mporDays, const std::string& name,
97 const std::string version)
98 : SimmConfigurationBase(simmBucketMapper, name, version, mporDays) {
99
100 // The differences in methodology for 1 Day horizon is described in
101 // Standard Initial Margin Model: Technical Paper, ISDA SIMM Governance Forum, Version 10:
102 // Section I - Calibration with one-day horizon
103 QL_REQUIRE(mporDays_ == 10 || mporDays_ == 1, "SIMM only supports MPOR 10-day or 1-day");
104
105 // Set up the correct concentration threshold getter
106 if (mporDays == 10) {
107 simmConcentration_ = QuantLib::ext::make_shared<SimmConcentration_ISDA_V2_5>(simmBucketMapper_);
108 } else {
109 // SIMM:Technical Paper, Section I.4: "The Concentration Risk feature is disabled"
110 simmConcentration_ = QuantLib::ext::make_shared<SimmConcentrationBase>();
111 }
112
113 // clang-format off
114
115 // Set up the members for this configuration
116 // Explanations of all these members are given in the hpp file
117
118 mapBuckets_ = {
119 { RiskType::IRCurve, { "1", "2", "3" } },
120 { RiskType::CreditQ, { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "Residual" } },
121 { RiskType::CreditVol, { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "Residual" } },
122 { RiskType::CreditNonQ, { "1", "2", "Residual" } },
123 { RiskType::CreditVolNonQ, { "1", "2", "Residual" } },
124 { RiskType::Equity, { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "Residual" } },
125 { RiskType::EquityVol, { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "Residual" } },
126 { RiskType::Commodity, { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17" } },
127 { RiskType::CommodityVol, { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17" } }
128 };
129
130 mapLabels_1_ = {
131 { RiskType::IRCurve, { "2w", "1m", "3m", "6m", "1y", "2y", "3y", "5y", "10y", "15y", "20y", "30y" } },
132 { RiskType::CreditQ, { "1y", "2y", "3y", "5y", "10y" } },
133 { RiskType::CreditNonQ, { "1y", "2y", "3y", "5y", "10y" } },
134 { RiskType::IRVol, { "2w", "1m", "3m", "6m", "1y", "2y", "3y", "5y", "10y", "15y", "20y", "30y" } },
135 { RiskType::InflationVol, { "2w", "1m", "3m", "6m", "1y", "2y", "3y", "5y", "10y", "15y", "20y", "30y" } },
136 { RiskType::CreditVol, { "1y", "2y", "3y", "5y", "10y" } },
137 { RiskType::CreditVolNonQ, { "1y", "2y", "3y", "5y", "10y" } },
138 { RiskType::EquityVol, { "2w", "1m", "3m", "6m", "1y", "2y", "3y", "5y", "10y", "15y", "20y", "30y" } },
139 { RiskType::CommodityVol, { "2w", "1m", "3m", "6m", "1y", "2y", "3y", "5y", "10y", "15y", "20y", "30y" } },
140 { RiskType::FXVol, { "2w", "1m", "3m", "6m", "1y", "2y", "3y", "5y", "10y", "15y", "20y", "30y" } }
141 };
142
143 mapLabels_2_ = {
144 { RiskType::IRCurve, { "OIS", "Libor1m", "Libor3m", "Libor6m", "Libor12m", "Prime", "Municipal" } },
145 { RiskType::CreditQ, { "", "Sec" } }
146 };
147
148 // Populate CCY groups that are used for FX correlations and risk weights
149 // The groups consists of High Vol Currencies & regular vol currencies
150 ccyGroups_ = {
151 { 1, { "BRL", "RUB", "TRY", "ZAR" } },
152 { 0, { } }
153 };
154
155 vector<Real> temp;
156
157 if (mporDays_ == 10) {
158 // Risk weights
159 temp = {
160 7.4, 13.6,
161 13.6, 14.6
162 };
163 rwFX_ = Matrix(2, 2, temp.begin(), temp.end());
164
165 rwRiskType_ = {
166 { RiskType::Inflation, 63 },
167 { RiskType::XCcyBasis, 21 },
168 { RiskType::IRVol, 0.18 },
169 { RiskType::InflationVol, 0.18 },
170 { RiskType::CreditVol, 0.74 },
171 { RiskType::CreditVolNonQ, 0.74 },
172 { RiskType::CommodityVol, 0.6 },
173 { RiskType::FXVol, 0.47 },
174 { RiskType::BaseCorr, 10 }
175 };
176
177 rwBucket_ = {
178 {RiskType::CreditQ,
179 {{{"1", "", ""}, 75},
180 {{"2", "", ""}, 91},
181 {{"3", "", ""}, 78},
182 {{"4", "", ""}, 55},
183 {{"5", "", ""}, 67},
184 {{"6", "", ""}, 47},
185 {{"7", "", ""}, 187},
186 {{"8", "", ""}, 665},
187 {{"9", "", ""}, 262},
188 {{"10", "", ""}, 251},
189 {{"11", "", ""}, 172},
190 {{"12", "", ""}, 247},
191 {{"Residual", "", ""}, 665}}},
192 {RiskType::CreditNonQ, {{{"1", "", ""}, 280}, {{"2", "", ""}, 1300}, {{"Residual", "", ""}, 1300}}},
193 {RiskType::Equity,
194 {{{"1", "", ""}, 26},
195 {{"2", "", ""}, 28},
196 {{"3", "", ""}, 34},
197 {{"4", "", ""}, 28},
198 {{"5", "", ""}, 23},
199 {{"6", "", ""}, 25},
200 {{"7", "", ""}, 29},
201 {{"8", "", ""}, 27},
202 {{"9", "", ""}, 32},
203 {{"10", "", ""}, 32},
204 {{"11", "", ""}, 18},
205 {{"12", "", ""}, 18},
206 {{"Residual", "", ""}, 34}}},
207 {RiskType::Commodity,
208 {{{"1", "", ""}, 27},
209 {{"2", "", ""}, 29},
210 {{"3", "", ""}, 33},
211 {{"4", "", ""}, 25},
212 {{"5", "", ""}, 35},
213 {{"6", "", ""}, 24},
214 {{"7", "", ""}, 40},
215 {{"8", "", ""}, 53},
216 {{"9", "", ""}, 44},
217 {{"10", "", ""}, 58},
218 {{"11", "", ""}, 20},
219 {{"12", "", ""}, 21},
220 {{"13", "", ""}, 13},
221 {{"14", "", ""}, 16},
222 {{"15", "", ""}, 13},
223 {{"16", "", ""}, 58},
224 {{"17", "", ""}, 17}}},
225 {RiskType::EquityVol,
226 {{{"1", "", ""}, 0.45},
227 {{"2", "", ""}, 0.45},
228 {{"3", "", ""}, 0.45},
229 {{"4", "", ""}, 0.45},
230 {{"5", "", ""}, 0.45},
231 {{"6", "", ""}, 0.45},
232 {{"7", "", ""}, 0.45},
233 {{"8", "", ""}, 0.45},
234 {{"9", "", ""}, 0.45},
235 {{"10", "", ""}, 0.45},
236 {{"11", "", ""}, 0.45},
237 {{"12", "", ""}, 0.96},
238 {{"Residual", "", ""}, 0.45}}},
239 };
240
241 rwLabel_1_ = {
242 {RiskType::IRCurve,
243 {{{"1", "2w", ""}, 115},
244 {{"1", "1m", ""}, 112},
245 {{"1", "3m", ""}, 96},
246 {{"1", "6m", ""}, 74},
247 {{"1", "1y", ""}, 66},
248 {{"1", "2y", ""}, 61},
249 {{"1", "3y", ""}, 56},
250 {{"1", "5y", ""}, 52},
251 {{"1", "10y", ""}, 53},
252 {{"1", "15y", ""}, 57},
253 {{"1", "20y", ""}, 60},
254 {{"1", "30y", ""}, 66},
255 {{"2", "2w", ""}, 15},
256 {{"2", "1m", ""}, 18},
257 {{"2", "3m", ""}, 9.0},
258 {{"2", "6m", ""}, 11},
259 {{"2", "1y", ""}, 13},
260 {{"2", "2y", ""}, 15},
261 {{"2", "3y", ""}, 18},
262 {{"2", "5y", ""}, 20},
263 {{"2", "10y", ""}, 19},
264 {{"2", "15y", ""}, 19},
265 {{"2", "20y", ""}, 20},
266 {{"2", "30y", ""}, 23},
267 {{"3", "2w", ""}, 119},
268 {{"3", "1m", ""}, 93},
269 {{"3", "3m", ""}, 80},
270 {{"3", "6m", ""}, 82},
271 {{"3", "1y", ""}, 90},
272 {{"3", "2y", ""}, 92},
273 {{"3", "3y", ""}, 95},
274 {{"3", "5y", ""}, 95},
275 {{"3", "10y", ""}, 94},
276 {{"3", "15y", ""}, 108},
277 {{"3", "20y", ""}, 105},
278 {{"3", "30y", ""}, 101}}},
279 };
280
281 // Historical volatility ratios
282 historicalVolatilityRatios_[RiskType::EquityVol] = 0.58;
283 historicalVolatilityRatios_[RiskType::CommodityVol] = 0.69;
284 historicalVolatilityRatios_[RiskType::FXVol] = 0.52;
285 hvr_ir_ = 0.44;
286
287 // Curvature weights
289 { RiskType::IRVol, { 0.5,
290 0.5 * 14.0 / (365.0 / 12.0),
291 0.5 * 14.0 / (3.0 * 365.0 / 12.0),
292 0.5 * 14.0 / (6.0 * 365.0 / 12.0),
293 0.5 * 14.0 / 365.0,
294 0.5 * 14.0 / (2.0 * 365.0),
295 0.5 * 14.0 / (3.0 * 365.0),
296 0.5 * 14.0 / (5.0 * 365.0),
297 0.5 * 14.0 / (10.0 * 365.0),
298 0.5 * 14.0 / (15.0 * 365.0),
299 0.5 * 14.0 / (20.0 * 365.0),
300 0.5 * 14.0 / (30.0 * 365.0) }
301 },
302 { RiskType::CreditVol, { 0.5 * 14.0 / 365.0,
303 0.5 * 14.0 / (2.0 * 365.0),
304 0.5 * 14.0 / (3.0 * 365.0),
305 0.5 * 14.0 / (5.0 * 365.0),
306 0.5 * 14.0 / (10.0 * 365.0) }
307 }
308 };
309 curvatureWeights_[RiskType::InflationVol] = curvatureWeights_[RiskType::IRVol];
310 curvatureWeights_[RiskType::EquityVol] = curvatureWeights_[RiskType::IRVol];
311 curvatureWeights_[RiskType::CommodityVol] = curvatureWeights_[RiskType::IRVol];
312 curvatureWeights_[RiskType::FXVol] = curvatureWeights_[RiskType::IRVol];
313 curvatureWeights_[RiskType::CreditVolNonQ] = curvatureWeights_[RiskType::CreditVol];
314
315 } else {
316 // SIMM:Technical Paper, Section I.1: "All delta and vega risk weights should be replaced with the values for
317 // one-day calibration given in the Calibration Results document."
318
319 // Risk weights
320 temp = {
321 1.8, 3.2,
322 3.2, 3.4
323 };
324 rwFX_ = Matrix(2, 2, temp.begin(), temp.end());
325
326 rwRiskType_ = {
327 { RiskType::Inflation, 15 },
328 { RiskType::XCcyBasis, 5.9 },
329 { RiskType::IRVol, 0.047 },
330 { RiskType::InflationVol, 0.047 },
331 { RiskType::CreditVol, 0.085 },
332 { RiskType::CreditVolNonQ, 0.085 },
333 { RiskType::CommodityVol, 0.16 },
334 { RiskType::FXVol, 0.096 },
335 { RiskType::BaseCorr, 2.5 }
336 };
337
338 rwBucket_ = {
339 {RiskType::CreditQ,
340 {{{"1", "", ""}, 21},
341 {{"2", "", ""}, 27},
342 {{"3", "", ""}, 16},
343 {{"4", "", ""}, 12},
344 {{"5", "", ""}, 14},
345 {{"6", "", ""}, 12},
346 {{"7", "", ""}, 48},
347 {{"8", "", ""}, 144},
348 {{"9", "", ""}, 51},
349 {{"10", "", ""}, 53},
350 {{"11", "", ""}, 38},
351 {{"12", "", ""}, 57},
352 {{"Residual", "", ""}, 144}}},
353 {RiskType::CreditNonQ, {{{"1", "", ""}, 66}, {{"2", "", ""}, 250}, {{"Residual", "", ""}, 250}}},
354 {RiskType::Equity,
355 {{{"1", "", ""}, 9.3},
356 {{"2", "", ""}, 9.7},
357 {{"3", "", ""}, 10.0},
358 {{"4", "", ""}, 9.2},
359 {{"5", "", ""}, 7.7},
360 {{"6", "", ""}, 8.5},
361 {{"7", "", ""}, 9.5},
362 {{"8", "", ""}, 9.6},
363 {{"9", "", ""}, 10.0},
364 {{"10", "", ""}, 10},
365 {{"11", "", ""}, 5.9},
366 {{"12", "", ""}, 5.9},
367 {{"Residual", "", ""}, 10.0}}},
368 {RiskType::Commodity,
369 {{{"1", "", ""}, 9.0},
370 {{"2", "", ""}, 9.1},
371 {{"3", "", ""}, 8.1},
372 {{"4", "", ""}, 7.2},
373 {{"5", "", ""}, 10},
374 {{"6", "", ""}, 8.2},
375 {{"7", "", ""}, 9.7},
376 {{"8", "", ""}, 10},
377 {{"9", "", ""}, 10},
378 {{"10", "", ""}, 16},
379 {{"11", "", ""}, 6.2},
380 {{"12", "", ""}, 6.5},
381 {{"13", "", ""}, 4.6},
382 {{"14", "", ""}, 4.6},
383 {{"15", "", ""}, 4.0},
384 {{"16", "", ""}, 16},
385 {{"17", "", ""}, 5.1}}},
386 {RiskType::EquityVol,
387 {{{"1", "", ""}, 0.093},
388 {{"2", "", ""}, 0.093},
389 {{"3", "", ""}, 0.093},
390 {{"4", "", ""}, 0.093},
391 {{"5", "", ""}, 0.093},
392 {{"6", "", ""}, 0.093},
393 {{"7", "", ""}, 0.093},
394 {{"8", "", ""}, 0.093},
395 {{"9", "", ""}, 0.093},
396 {{"10", "", ""}, 0.093},
397 {{"11", "", ""}, 0.093},
398 {{"12", "", ""}, 0.25},
399 {{"Residual", "", ""}, 0.093}}},
400 };
401
402 rwLabel_1_ = {
403 {RiskType::IRCurve,
404 {{{"1", "2w", ""}, 19},
405 {{"1", "1m", ""}, 16},
406 {{"1", "3m", ""}, 12},
407 {{"1", "6m", ""}, 12},
408 {{"1", "1y", ""}, 13},
409 {{"1", "2y", ""}, 16},
410 {{"1", "3y", ""}, 16},
411 {{"1", "5y", ""}, 16},
412 {{"1", "10y", ""}, 16},
413 {{"1", "15y", ""}, 17},
414 {{"1", "20y", ""}, 16},
415 {{"1", "30y", ""}, 17},
416 {{"2", "2w", ""}, 1.7},
417 {{"2", "1m", ""}, 3.4},
418 {{"2", "3m", ""}, 1.8},
419 {{"2", "6m", ""}, 2.0},
420 {{"2", "1y", ""}, 3.3},
421 {{"2", "2y", ""}, 4.8},
422 {{"2", "3y", ""}, 5.8},
423 {{"2", "5y", ""}, 6.8},
424 {{"2", "10y", ""}, 6.5},
425 {{"2", "15y", ""}, 7.0},
426 {{"2", "20y", ""}, 7.5},
427 {{"2", "30y", ""}, 8.3},
428 {{"3", "2w", ""}, 49},
429 {{"3", "1m", ""}, 24},
430 {{"3", "3m", ""}, 16},
431 {{"3", "6m", ""}, 20},
432 {{"3", "1y", ""}, 23},
433 {{"3", "2y", ""}, 23},
434 {{"3", "3y", ""}, 33},
435 {{"3", "5y", ""}, 31},
436 {{"3", "10y", ""}, 34},
437 {{"3", "15y", ""}, 33},
438 {{"3", "20y", ""}, 33},
439 {{"3", "30y", ""}, 27}}}
440 };
441
442 // Historical volatility ratios
443 historicalVolatilityRatios_[RiskType::EquityVol] = 0.54;
444 historicalVolatilityRatios_[RiskType::CommodityVol] = 0.69;
445 historicalVolatilityRatios_[RiskType::FXVol] = 0.7;
446 hvr_ir_ = 0.51;
447
448 // Curvature weights
449 //SIMM:Technical Paper, Section I.3, this 10-day formula for curvature weights is modified
451 { RiskType::IRVol, { 0.5 / 10.0,
452 0.5 * 1.40 / (365.0 / 12.0),
453 0.5 * 1.40 / (3.0 * 365.0 / 12.0),
454 0.5 * 1.40 / (6.0 * 365.0 / 12.0),
455 0.5 * 1.40 / 365.0,
456 0.5 * 1.40 / (2.0 * 365.0),
457 0.5 * 1.40 / (3.0 * 365.0),
458 0.5 * 1.40 / (5.0 * 365.0),
459 0.5 * 1.40 / (10.0 * 365.0),
460 0.5 * 1.40 / (15.0 * 365.0),
461 0.5 * 1.40 / (20.0 * 365.0),
462 0.5 * 1.40 / (30.0 * 365.0) }
463 },
464 { RiskType::CreditVol, { 0.5 * 1.40 / 365.0,
465 0.5 * 1.40 / (2.0 * 365.0),
466 0.5 * 1.40 / (3.0 * 365.0),
467 0.5 * 1.40 / (5.0 * 365.0),
468 0.5 * 1.40 / (10.0 * 365.0) }
469 }
470 };
471 curvatureWeights_[RiskType::InflationVol] = curvatureWeights_[RiskType::IRVol];
472 curvatureWeights_[RiskType::EquityVol] = curvatureWeights_[RiskType::IRVol];
473 curvatureWeights_[RiskType::CommodityVol] = curvatureWeights_[RiskType::IRVol];
474 curvatureWeights_[RiskType::FXVol] = curvatureWeights_[RiskType::IRVol];
475 curvatureWeights_[RiskType::CreditVolNonQ] = curvatureWeights_[RiskType::CreditVol];
476 }
477
478
479 // Valid risk types
481 RiskType::Commodity,
482 RiskType::CommodityVol,
483 RiskType::CreditNonQ,
484 RiskType::CreditQ,
485 RiskType::CreditVol,
486 RiskType::CreditVolNonQ,
487 RiskType::Equity,
488 RiskType::EquityVol,
489 RiskType::FX,
490 RiskType::FXVol,
491 RiskType::Inflation,
492 RiskType::IRCurve,
493 RiskType::IRVol,
494 RiskType::InflationVol,
495 RiskType::BaseCorr,
496 RiskType::XCcyBasis,
497 RiskType::ProductClassMultiplier,
498 RiskType::AddOnNotionalFactor,
499 RiskType::PV,
500 RiskType::Notional,
501 RiskType::AddOnFixedAmount
502 };
503
504 // Risk class correlation matrix
506 {{"", "InterestRate", "CreditQualifying"}, 0.29},
507 {{"", "InterestRate", "CreditNonQualifying"}, 0.13},
508 {{"", "InterestRate", "Equity"}, 0.28},
509 {{"", "InterestRate", "Commodity"}, 0.46},
510 {{"", "InterestRate", "FX"}, 0.32},
511 {{"", "CreditQualifying", "InterestRate"}, 0.29},
512 {{"", "CreditQualifying", "CreditNonQualifying"}, 0.54},
513 {{"", "CreditQualifying", "Equity"}, 0.71},
514 {{"", "CreditQualifying", "Commodity"}, 0.52},
515 {{"", "CreditQualifying", "FX"}, 0.38},
516 {{"", "CreditNonQualifying", "InterestRate"}, 0.13},
517 {{"", "CreditNonQualifying", "CreditQualifying"}, 0.54},
518 {{"", "CreditNonQualifying", "Equity"}, 0.46},
519 {{"", "CreditNonQualifying", "Commodity"}, 0.41},
520 {{"", "CreditNonQualifying", "FX"}, 0.12},
521 {{"", "Equity", "InterestRate"}, 0.28},
522 {{"", "Equity", "CreditQualifying"}, 0.71},
523 {{"", "Equity", "CreditNonQualifying"}, 0.46},
524 {{"", "Equity", "Commodity"}, 0.49},
525 {{"", "Equity", "FX"}, 0.35},
526 {{"", "Commodity", "InterestRate"}, 0.46},
527 {{"", "Commodity", "CreditQualifying"}, 0.52},
528 {{"", "Commodity", "CreditNonQualifying"}, 0.41},
529 {{"", "Commodity", "Equity"}, 0.49},
530 {{"", "Commodity", "FX"}, 0.41},
531 {{"", "FX", "InterestRate"}, 0.32},
532 {{"", "FX", "CreditQualifying"}, 0.38},
533 {{"", "FX", "CreditNonQualifying"}, 0.12},
534 {{"", "FX", "Equity"}, 0.35},
535 {{"", "FX", "Commodity"}, 0.41}
536 };
537
538 // FX correlations
539 temp = {
540 0.5, 0.27,
541 0.27, 0.42
542 };
543 fxRegVolCorrelation_ = Matrix(2, 2, temp.begin(), temp.end());
544
545 temp = {
546 0.85, 0.54,
547 0.54, 0.5
548 };
549 fxHighVolCorrelation_ = Matrix(2, 2, temp.begin(), temp.end());
550
551 // Interest rate tenor correlations (i.e. Label1 level correlations)
552 intraBucketCorrelation_[RiskType::IRCurve] = {
553 {{"", "2w", "1m"}, 0.74},
554 {{"", "2w", "3m"}, 0.63},
555 {{"", "2w", "6m"}, 0.55},
556 {{"", "2w", "1y"}, 0.45},
557 {{"", "2w", "2y"}, 0.36},
558 {{"", "2w", "3y"}, 0.32},
559 {{"", "2w", "5y"}, 0.28},
560 {{"", "2w", "10y"}, 0.23},
561 {{"", "2w", "15y"}, 0.2},
562 {{"", "2w", "20y"}, 0.18},
563 {{"", "2w", "30y"}, 0.16},
564 {{"", "1m", "2w"}, 0.74},
565 {{"", "1m", "3m"}, 0.8},
566 {{"", "1m", "6m"}, 0.69},
567 {{"", "1m", "1y"}, 0.52},
568 {{"", "1m", "2y"}, 0.41},
569 {{"", "1m", "3y"}, 0.35},
570 {{"", "1m", "5y"}, 0.29},
571 {{"", "1m", "10y"}, 0.24},
572 {{"", "1m", "15y"}, 0.18},
573 {{"", "1m", "20y"}, 0.17},
574 {{"", "1m", "30y"}, 0.16},
575 {{"", "3m", "2w"}, 0.63},
576 {{"", "3m", "1m"}, 0.8},
577 {{"", "3m", "6m"}, 0.85},
578 {{"", "3m", "1y"}, 0.67},
579 {{"", "3m", "2y"}, 0.53},
580 {{"", "3m", "3y"}, 0.45},
581 {{"", "3m", "5y"}, 0.39},
582 {{"", "3m", "10y"}, 0.32},
583 {{"", "3m", "15y"}, 0.24},
584 {{"", "3m", "20y"}, 0.22},
585 {{"", "3m", "30y"}, 0.22},
586 {{"", "6m", "2w"}, 0.55},
587 {{"", "6m", "1m"}, 0.69},
588 {{"", "6m", "3m"}, 0.85},
589 {{"", "6m", "1y"}, 0.83},
590 {{"", "6m", "2y"}, 0.71},
591 {{"", "6m", "3y"}, 0.62},
592 {{"", "6m", "5y"}, 0.54},
593 {{"", "6m", "10y"}, 0.45},
594 {{"", "6m", "15y"}, 0.36},
595 {{"", "6m", "20y"}, 0.35},
596 {{"", "6m", "30y"}, 0.33},
597 {{"", "1y", "2w"}, 0.45},
598 {{"", "1y", "1m"}, 0.52},
599 {{"", "1y", "3m"}, 0.67},
600 {{"", "1y", "6m"}, 0.83},
601 {{"", "1y", "2y"}, 0.94},
602 {{"", "1y", "3y"}, 0.86},
603 {{"", "1y", "5y"}, 0.78},
604 {{"", "1y", "10y"}, 0.65},
605 {{"", "1y", "15y"}, 0.58},
606 {{"", "1y", "20y"}, 0.55},
607 {{"", "1y", "30y"}, 0.53},
608 {{"", "2y", "2w"}, 0.36},
609 {{"", "2y", "1m"}, 0.41},
610 {{"", "2y", "3m"}, 0.53},
611 {{"", "2y", "6m"}, 0.71},
612 {{"", "2y", "1y"}, 0.94},
613 {{"", "2y", "3y"}, 0.95},
614 {{"", "2y", "5y"}, 0.89},
615 {{"", "2y", "10y"}, 0.78},
616 {{"", "2y", "15y"}, 0.72},
617 {{"", "2y", "20y"}, 0.68},
618 {{"", "2y", "30y"}, 0.67},
619 {{"", "3y", "2w"}, 0.32},
620 {{"", "3y", "1m"}, 0.35},
621 {{"", "3y", "3m"}, 0.45},
622 {{"", "3y", "6m"}, 0.62},
623 {{"", "3y", "1y"}, 0.86},
624 {{"", "3y", "2y"}, 0.95},
625 {{"", "3y", "5y"}, 0.96},
626 {{"", "3y", "10y"}, 0.87},
627 {{"", "3y", "15y"}, 0.8},
628 {{"", "3y", "20y"}, 0.77},
629 {{"", "3y", "30y"}, 0.74},
630 {{"", "5y", "2w"}, 0.28},
631 {{"", "5y", "1m"}, 0.29},
632 {{"", "5y", "3m"}, 0.39},
633 {{"", "5y", "6m"}, 0.54},
634 {{"", "5y", "1y"}, 0.78},
635 {{"", "5y", "2y"}, 0.89},
636 {{"", "5y", "3y"}, 0.96},
637 {{"", "5y", "10y"}, 0.94},
638 {{"", "5y", "15y"}, 0.89},
639 {{"", "5y", "20y"}, 0.86},
640 {{"", "5y", "30y"}, 0.84},
641 {{"", "10y", "2w"}, 0.23},
642 {{"", "10y", "1m"}, 0.24},
643 {{"", "10y", "3m"}, 0.32},
644 {{"", "10y", "6m"}, 0.45},
645 {{"", "10y", "1y"}, 0.65},
646 {{"", "10y", "2y"}, 0.78},
647 {{"", "10y", "3y"}, 0.87},
648 {{"", "10y", "5y"}, 0.94},
649 {{"", "10y", "15y"}, 0.97},
650 {{"", "10y", "20y"}, 0.95},
651 {{"", "10y", "30y"}, 0.94},
652 {{"", "15y", "2w"}, 0.2},
653 {{"", "15y", "1m"}, 0.18},
654 {{"", "15y", "3m"}, 0.24},
655 {{"", "15y", "6m"}, 0.36},
656 {{"", "15y", "1y"}, 0.58},
657 {{"", "15y", "2y"}, 0.72},
658 {{"", "15y", "3y"}, 0.8},
659 {{"", "15y", "5y"}, 0.89},
660 {{"", "15y", "10y"}, 0.97},
661 {{"", "15y", "20y"}, 0.98},
662 {{"", "15y", "30y"}, 0.98},
663 {{"", "20y", "2w"}, 0.18},
664 {{"", "20y", "1m"}, 0.17},
665 {{"", "20y", "3m"}, 0.22},
666 {{"", "20y", "6m"}, 0.35},
667 {{"", "20y", "1y"}, 0.55},
668 {{"", "20y", "2y"}, 0.68},
669 {{"", "20y", "3y"}, 0.77},
670 {{"", "20y", "5y"}, 0.86},
671 {{"", "20y", "10y"}, 0.95},
672 {{"", "20y", "15y"}, 0.98},
673 {{"", "20y", "30y"}, 0.99},
674 {{"", "30y", "2w"}, 0.16},
675 {{"", "30y", "1m"}, 0.16},
676 {{"", "30y", "3m"}, 0.22},
677 {{"", "30y", "6m"}, 0.33},
678 {{"", "30y", "1y"}, 0.53},
679 {{"", "30y", "2y"}, 0.67},
680 {{"", "30y", "3y"}, 0.74},
681 {{"", "30y", "5y"}, 0.84},
682 {{"", "30y", "10y"}, 0.94},
683 {{"", "30y", "15y"}, 0.98},
684 {{"", "30y", "20y"}, 0.99}
685 };
686
687 // CreditQ inter-bucket correlations
688 interBucketCorrelation_[RiskType::CreditQ] = {
689 {{"", "1", "2"}, 0.36},
690 {{"", "1", "3"}, 0.38},
691 {{"", "1", "4"}, 0.35},
692 {{"", "1", "5"}, 0.37},
693 {{"", "1", "6"}, 0.33},
694 {{"", "1", "7"}, 0.36},
695 {{"", "1", "8"}, 0.31},
696 {{"", "1", "9"}, 0.32},
697 {{"", "1", "10"}, 0.33},
698 {{"", "1", "11"}, 0.32},
699 {{"", "1", "12"}, 0.3},
700 {{"", "2", "1"}, 0.36},
701 {{"", "2", "3"}, 0.46},
702 {{"", "2", "4"}, 0.44},
703 {{"", "2", "5"}, 0.45},
704 {{"", "2", "6"}, 0.43},
705 {{"", "2", "7"}, 0.33},
706 {{"", "2", "8"}, 0.36},
707 {{"", "2", "9"}, 0.38},
708 {{"", "2", "10"}, 0.39},
709 {{"", "2", "11"}, 0.4},
710 {{"", "2", "12"}, 0.36},
711 {{"", "3", "1"}, 0.38},
712 {{"", "3", "2"}, 0.46},
713 {{"", "3", "4"}, 0.49},
714 {{"", "3", "5"}, 0.49},
715 {{"", "3", "6"}, 0.47},
716 {{"", "3", "7"}, 0.34},
717 {{"", "3", "8"}, 0.36},
718 {{"", "3", "9"}, 0.41},
719 {{"", "3", "10"}, 0.42},
720 {{"", "3", "11"}, 0.43},
721 {{"", "3", "12"}, 0.39},
722 {{"", "4", "1"}, 0.35},
723 {{"", "4", "2"}, 0.44},
724 {{"", "4", "3"}, 0.49},
725 {{"", "4", "5"}, 0.48},
726 {{"", "4", "6"}, 0.48},
727 {{"", "4", "7"}, 0.31},
728 {{"", "4", "8"}, 0.34},
729 {{"", "4", "9"}, 0.38},
730 {{"", "4", "10"}, 0.42},
731 {{"", "4", "11"}, 0.41},
732 {{"", "4", "12"}, 0.37},
733 {{"", "5", "1"}, 0.37},
734 {{"", "5", "2"}, 0.45},
735 {{"", "5", "3"}, 0.49},
736 {{"", "5", "4"}, 0.48},
737 {{"", "5", "6"}, 0.48},
738 {{"", "5", "7"}, 0.33},
739 {{"", "5", "8"}, 0.35},
740 {{"", "5", "9"}, 0.39},
741 {{"", "5", "10"}, 0.42},
742 {{"", "5", "11"}, 0.43},
743 {{"", "5", "12"}, 0.38},
744 {{"", "6", "1"}, 0.33},
745 {{"", "6", "2"}, 0.43},
746 {{"", "6", "3"}, 0.47},
747 {{"", "6", "4"}, 0.48},
748 {{"", "6", "5"}, 0.48},
749 {{"", "6", "7"}, 0.29},
750 {{"", "6", "8"}, 0.32},
751 {{"", "6", "9"}, 0.36},
752 {{"", "6", "10"}, 0.39},
753 {{"", "6", "11"}, 0.4},
754 {{"", "6", "12"}, 0.35},
755 {{"", "7", "1"}, 0.36},
756 {{"", "7", "2"}, 0.33},
757 {{"", "7", "3"}, 0.34},
758 {{"", "7", "4"}, 0.31},
759 {{"", "7", "5"}, 0.33},
760 {{"", "7", "6"}, 0.29},
761 {{"", "7", "8"}, 0.28},
762 {{"", "7", "9"}, 0.32},
763 {{"", "7", "10"}, 0.31},
764 {{"", "7", "11"}, 0.3},
765 {{"", "7", "12"}, 0.28},
766 {{"", "8", "1"}, 0.31},
767 {{"", "8", "2"}, 0.36},
768 {{"", "8", "3"}, 0.36},
769 {{"", "8", "4"}, 0.34},
770 {{"", "8", "5"}, 0.35},
771 {{"", "8", "6"}, 0.32},
772 {{"", "8", "7"}, 0.28},
773 {{"", "8", "9"}, 0.33},
774 {{"", "8", "10"}, 0.34},
775 {{"", "8", "11"}, 0.33},
776 {{"", "8", "12"}, 0.3},
777 {{"", "9", "1"}, 0.32},
778 {{"", "9", "2"}, 0.38},
779 {{"", "9", "3"}, 0.41},
780 {{"", "9", "4"}, 0.38},
781 {{"", "9", "5"}, 0.39},
782 {{"", "9", "6"}, 0.36},
783 {{"", "9", "7"}, 0.32},
784 {{"", "9", "8"}, 0.33},
785 {{"", "9", "10"}, 0.38},
786 {{"", "9", "11"}, 0.36},
787 {{"", "9", "12"}, 0.34},
788 {{"", "10", "1"}, 0.33},
789 {{"", "10", "2"}, 0.39},
790 {{"", "10", "3"}, 0.42},
791 {{"", "10", "4"}, 0.42},
792 {{"", "10", "5"}, 0.42},
793 {{"", "10", "6"}, 0.39},
794 {{"", "10", "7"}, 0.31},
795 {{"", "10", "8"}, 0.34},
796 {{"", "10", "9"}, 0.38},
797 {{"", "10", "11"}, 0.38},
798 {{"", "10", "12"}, 0.36},
799 {{"", "11", "1"}, 0.32},
800 {{"", "11", "2"}, 0.4},
801 {{"", "11", "3"}, 0.43},
802 {{"", "11", "4"}, 0.41},
803 {{"", "11", "5"}, 0.43},
804 {{"", "11", "6"}, 0.4},
805 {{"", "11", "7"}, 0.3},
806 {{"", "11", "8"}, 0.33},
807 {{"", "11", "9"}, 0.36},
808 {{"", "11", "10"}, 0.38},
809 {{"", "11", "12"}, 0.35},
810 {{"", "12", "1"}, 0.3},
811 {{"", "12", "2"}, 0.36},
812 {{"", "12", "3"}, 0.39},
813 {{"", "12", "4"}, 0.37},
814 {{"", "12", "5"}, 0.38},
815 {{"", "12", "6"}, 0.35},
816 {{"", "12", "7"}, 0.28},
817 {{"", "12", "8"}, 0.3},
818 {{"", "12", "9"}, 0.34},
819 {{"", "12", "10"}, 0.36},
820 {{"", "12", "11"}, 0.35}
821 };
822
823 // Equity inter-bucket correlations
824 interBucketCorrelation_[RiskType::Equity] = {
825 {{"", "1", "2"}, 0.2},
826 {{"", "1", "3"}, 0.2},
827 {{"", "1", "4"}, 0.2},
828 {{"", "1", "5"}, 0.13},
829 {{"", "1", "6"}, 0.16},
830 {{"", "1", "7"}, 0.16},
831 {{"", "1", "8"}, 0.16},
832 {{"", "1", "9"}, 0.17},
833 {{"", "1", "10"}, 0.12},
834 {{"", "1", "11"}, 0.18},
835 {{"", "1", "12"}, 0.18},
836 {{"", "2", "1"}, 0.2},
837 {{"", "2", "3"}, 0.25},
838 {{"", "2", "4"}, 0.23},
839 {{"", "2", "5"}, 0.14},
840 {{"", "2", "6"}, 0.17},
841 {{"", "2", "7"}, 0.18},
842 {{"", "2", "8"}, 0.17},
843 {{"", "2", "9"}, 0.19},
844 {{"", "2", "10"}, 0.13},
845 {{"", "2", "11"}, 0.19},
846 {{"", "2", "12"}, 0.19},
847 {{"", "3", "1"}, 0.2},
848 {{"", "3", "2"}, 0.25},
849 {{"", "3", "4"}, 0.24},
850 {{"", "3", "5"}, 0.13},
851 {{"", "3", "6"}, 0.17},
852 {{"", "3", "7"}, 0.18},
853 {{"", "3", "8"}, 0.16},
854 {{"", "3", "9"}, 0.2},
855 {{"", "3", "10"}, 0.13},
856 {{"", "3", "11"}, 0.18},
857 {{"", "3", "12"}, 0.18},
858 {{"", "4", "1"}, 0.2},
859 {{"", "4", "2"}, 0.23},
860 {{"", "4", "3"}, 0.24},
861 {{"", "4", "5"}, 0.17},
862 {{"", "4", "6"}, 0.22},
863 {{"", "4", "7"}, 0.22},
864 {{"", "4", "8"}, 0.22},
865 {{"", "4", "9"}, 0.21},
866 {{"", "4", "10"}, 0.16},
867 {{"", "4", "11"}, 0.24},
868 {{"", "4", "12"}, 0.24},
869 {{"", "5", "1"}, 0.13},
870 {{"", "5", "2"}, 0.14},
871 {{"", "5", "3"}, 0.13},
872 {{"", "5", "4"}, 0.17},
873 {{"", "5", "6"}, 0.27},
874 {{"", "5", "7"}, 0.26},
875 {{"", "5", "8"}, 0.27},
876 {{"", "5", "9"}, 0.15},
877 {{"", "5", "10"}, 0.2},
878 {{"", "5", "11"}, 0.3},
879 {{"", "5", "12"}, 0.3},
880 {{"", "6", "1"}, 0.16},
881 {{"", "6", "2"}, 0.17},
882 {{"", "6", "3"}, 0.17},
883 {{"", "6", "4"}, 0.22},
884 {{"", "6", "5"}, 0.27},
885 {{"", "6", "7"}, 0.34},
886 {{"", "6", "8"}, 0.33},
887 {{"", "6", "9"}, 0.18},
888 {{"", "6", "10"}, 0.24},
889 {{"", "6", "11"}, 0.38},
890 {{"", "6", "12"}, 0.38},
891 {{"", "7", "1"}, 0.16},
892 {{"", "7", "2"}, 0.18},
893 {{"", "7", "3"}, 0.18},
894 {{"", "7", "4"}, 0.22},
895 {{"", "7", "5"}, 0.26},
896 {{"", "7", "6"}, 0.34},
897 {{"", "7", "8"}, 0.32},
898 {{"", "7", "9"}, 0.18},
899 {{"", "7", "10"}, 0.24},
900 {{"", "7", "11"}, 0.37},
901 {{"", "7", "12"}, 0.37},
902 {{"", "8", "1"}, 0.16},
903 {{"", "8", "2"}, 0.17},
904 {{"", "8", "3"}, 0.16},
905 {{"", "8", "4"}, 0.22},
906 {{"", "8", "5"}, 0.27},
907 {{"", "8", "6"}, 0.33},
908 {{"", "8", "7"}, 0.32},
909 {{"", "8", "9"}, 0.18},
910 {{"", "8", "10"}, 0.23},
911 {{"", "8", "11"}, 0.37},
912 {{"", "8", "12"}, 0.37},
913 {{"", "9", "1"}, 0.17},
914 {{"", "9", "2"}, 0.19},
915 {{"", "9", "3"}, 0.2},
916 {{"", "9", "4"}, 0.21},
917 {{"", "9", "5"}, 0.15},
918 {{"", "9", "6"}, 0.18},
919 {{"", "9", "7"}, 0.18},
920 {{"", "9", "8"}, 0.18},
921 {{"", "9", "10"}, 0.14},
922 {{"", "9", "11"}, 0.2},
923 {{"", "9", "12"}, 0.2},
924 {{"", "10", "1"}, 0.12},
925 {{"", "10", "2"}, 0.13},
926 {{"", "10", "3"}, 0.13},
927 {{"", "10", "4"}, 0.16},
928 {{"", "10", "5"}, 0.2},
929 {{"", "10", "6"}, 0.24},
930 {{"", "10", "7"}, 0.24},
931 {{"", "10", "8"}, 0.23},
932 {{"", "10", "9"}, 0.14},
933 {{"", "10", "11"}, 0.25},
934 {{"", "10", "12"}, 0.25},
935 {{"", "11", "1"}, 0.18},
936 {{"", "11", "2"}, 0.19},
937 {{"", "11", "3"}, 0.18},
938 {{"", "11", "4"}, 0.24},
939 {{"", "11", "5"}, 0.3},
940 {{"", "11", "6"}, 0.38},
941 {{"", "11", "7"}, 0.37},
942 {{"", "11", "8"}, 0.37},
943 {{"", "11", "9"}, 0.2},
944 {{"", "11", "10"}, 0.25},
945 {{"", "11", "12"}, 0.45},
946 {{"", "12", "1"}, 0.18},
947 {{"", "12", "2"}, 0.19},
948 {{"", "12", "3"}, 0.18},
949 {{"", "12", "4"}, 0.24},
950 {{"", "12", "5"}, 0.3},
951 {{"", "12", "6"}, 0.38},
952 {{"", "12", "7"}, 0.37},
953 {{"", "12", "8"}, 0.37},
954 {{"", "12", "9"}, 0.2},
955 {{"", "12", "10"}, 0.25},
956 {{"", "12", "11"}, 0.45}
957 };
958
959 // Commodity inter-bucket correlations
960 interBucketCorrelation_[RiskType::Commodity] = {
961 {{"", "1", "2"}, 0.33},
962 {{"", "1", "3"}, 0.21},
963 {{"", "1", "4"}, 0.27},
964 {{"", "1", "5"}, 0.29},
965 {{"", "1", "6"}, 0.21},
966 {{"", "1", "7"}, 0.48},
967 {{"", "1", "8"}, 0.16},
968 {{"", "1", "9"}, 0.41},
969 {{"", "1", "10"}, 0.23},
970 {{"", "1", "11"}, 0.18},
971 {{"", "1", "12"}, 0.02},
972 {{"", "1", "13"}, 0.21},
973 {{"", "1", "14"}, 0.19},
974 {{"", "1", "15"}, 0.15},
975 {{"", "1", "16"}, 0.0},
976 {{"", "1", "17"}, 0.24},
977 {{"", "2", "1"}, 0.33},
978 {{"", "2", "3"}, 0.94},
979 {{"", "2", "4"}, 0.94},
980 {{"", "2", "5"}, 0.89},
981 {{"", "2", "6"}, 0.21},
982 {{"", "2", "7"}, 0.19},
983 {{"", "2", "8"}, 0.13},
984 {{"", "2", "9"}, 0.21},
985 {{"", "2", "10"}, 0.21},
986 {{"", "2", "11"}, 0.41},
987 {{"", "2", "12"}, 0.27},
988 {{"", "2", "13"}, 0.31},
989 {{"", "2", "14"}, 0.29},
990 {{"", "2", "15"}, 0.21},
991 {{"", "2", "16"}, 0.0},
992 {{"", "2", "17"}, 0.6},
993 {{"", "3", "1"}, 0.21},
994 {{"", "3", "2"}, 0.94},
995 {{"", "3", "4"}, 0.91},
996 {{"", "3", "5"}, 0.85},
997 {{"", "3", "6"}, 0.12},
998 {{"", "3", "7"}, 0.2},
999 {{"", "3", "8"}, 0.09},
1000 {{"", "3", "9"}, 0.19},
1001 {{"", "3", "10"}, 0.2},
1002 {{"", "3", "11"}, 0.36},
1003 {{"", "3", "12"}, 0.18},
1004 {{"", "3", "13"}, 0.22},
1005 {{"", "3", "14"}, 0.23},
1006 {{"", "3", "15"}, 0.23},
1007 {{"", "3", "16"}, 0.0},
1008 {{"", "3", "17"}, 0.54},
1009 {{"", "4", "1"}, 0.27},
1010 {{"", "4", "2"}, 0.94},
1011 {{"", "4", "3"}, 0.91},
1012 {{"", "4", "5"}, 0.84},
1013 {{"", "4", "6"}, 0.14},
1014 {{"", "4", "7"}, 0.24},
1015 {{"", "4", "8"}, 0.13},
1016 {{"", "4", "9"}, 0.21},
1017 {{"", "4", "10"}, 0.19},
1018 {{"", "4", "11"}, 0.39},
1019 {{"", "4", "12"}, 0.25},
1020 {{"", "4", "13"}, 0.23},
1021 {{"", "4", "14"}, 0.27},
1022 {{"", "4", "15"}, 0.18},
1023 {{"", "4", "16"}, 0.0},
1024 {{"", "4", "17"}, 0.59},
1025 {{"", "5", "1"}, 0.29},
1026 {{"", "5", "2"}, 0.89},
1027 {{"", "5", "3"}, 0.85},
1028 {{"", "5", "4"}, 0.84},
1029 {{"", "5", "6"}, 0.15},
1030 {{"", "5", "7"}, 0.17},
1031 {{"", "5", "8"}, 0.09},
1032 {{"", "5", "9"}, 0.16},
1033 {{"", "5", "10"}, 0.21},
1034 {{"", "5", "11"}, 0.38},
1035 {{"", "5", "12"}, 0.28},
1036 {{"", "5", "13"}, 0.28},
1037 {{"", "5", "14"}, 0.27},
1038 {{"", "5", "15"}, 0.18},
1039 {{"", "5", "16"}, 0.0},
1040 {{"", "5", "17"}, 0.55},
1041 {{"", "6", "1"}, 0.21},
1042 {{"", "6", "2"}, 0.21},
1043 {{"", "6", "3"}, 0.12},
1044 {{"", "6", "4"}, 0.14},
1045 {{"", "6", "5"}, 0.15},
1046 {{"", "6", "7"}, 0.33},
1047 {{"", "6", "8"}, 0.53},
1048 {{"", "6", "9"}, 0.26},
1049 {{"", "6", "10"}, 0.09},
1050 {{"", "6", "11"}, 0.21},
1051 {{"", "6", "12"}, 0.04},
1052 {{"", "6", "13"}, 0.11},
1053 {{"", "6", "14"}, 0.1},
1054 {{"", "6", "15"}, 0.09},
1055 {{"", "6", "16"}, 0.0},
1056 {{"", "6", "17"}, 0.24},
1057 {{"", "7", "1"}, 0.48},
1058 {{"", "7", "2"}, 0.19},
1059 {{"", "7", "3"}, 0.2},
1060 {{"", "7", "4"}, 0.24},
1061 {{"", "7", "5"}, 0.17},
1062 {{"", "7", "6"}, 0.33},
1063 {{"", "7", "8"}, 0.31},
1064 {{"", "7", "9"}, 0.72},
1065 {{"", "7", "10"}, 0.24},
1066 {{"", "7", "11"}, 0.14},
1067 {{"", "7", "12"}, -0.12},
1068 {{"", "7", "13"}, 0.19},
1069 {{"", "7", "14"}, 0.14},
1070 {{"", "7", "15"}, 0.08},
1071 {{"", "7", "16"}, 0.0},
1072 {{"", "7", "17"}, 0.24},
1073 {{"", "8", "1"}, 0.16},
1074 {{"", "8", "2"}, 0.13},
1075 {{"", "8", "3"}, 0.09},
1076 {{"", "8", "4"}, 0.13},
1077 {{"", "8", "5"}, 0.09},
1078 {{"", "8", "6"}, 0.53},
1079 {{"", "8", "7"}, 0.31},
1080 {{"", "8", "9"}, 0.24},
1081 {{"", "8", "10"}, 0.04},
1082 {{"", "8", "11"}, 0.13},
1083 {{"", "8", "12"}, -0.07},
1084 {{"", "8", "13"}, 0.04},
1085 {{"", "8", "14"}, 0.06},
1086 {{"", "8", "15"}, 0.01},
1087 {{"", "8", "16"}, 0.0},
1088 {{"", "8", "17"}, 0.16},
1089 {{"", "9", "1"}, 0.41},
1090 {{"", "9", "2"}, 0.21},
1091 {{"", "9", "3"}, 0.19},
1092 {{"", "9", "4"}, 0.21},
1093 {{"", "9", "5"}, 0.16},
1094 {{"", "9", "6"}, 0.26},
1095 {{"", "9", "7"}, 0.72},
1096 {{"", "9", "8"}, 0.24},
1097 {{"", "9", "10"}, 0.21},
1098 {{"", "9", "11"}, 0.18},
1099 {{"", "9", "12"}, -0.07},
1100 {{"", "9", "13"}, 0.12},
1101 {{"", "9", "14"}, 0.12},
1102 {{"", "9", "15"}, 0.1},
1103 {{"", "9", "16"}, 0.0},
1104 {{"", "9", "17"}, 0.21},
1105 {{"", "10", "1"}, 0.23},
1106 {{"", "10", "2"}, 0.21},
1107 {{"", "10", "3"}, 0.2},
1108 {{"", "10", "4"}, 0.19},
1109 {{"", "10", "5"}, 0.21},
1110 {{"", "10", "6"}, 0.09},
1111 {{"", "10", "7"}, 0.24},
1112 {{"", "10", "8"}, 0.04},
1113 {{"", "10", "9"}, 0.21},
1114 {{"", "10", "11"}, 0.14},
1115 {{"", "10", "12"}, 0.11},
1116 {{"", "10", "13"}, 0.11},
1117 {{"", "10", "14"}, 0.1},
1118 {{"", "10", "15"}, 0.07},
1119 {{"", "10", "16"}, 0.0},
1120 {{"", "10", "17"}, 0.14},
1121 {{"", "11", "1"}, 0.18},
1122 {{"", "11", "2"}, 0.41},
1123 {{"", "11", "3"}, 0.36},
1124 {{"", "11", "4"}, 0.39},
1125 {{"", "11", "5"}, 0.38},
1126 {{"", "11", "6"}, 0.21},
1127 {{"", "11", "7"}, 0.14},
1128 {{"", "11", "8"}, 0.13},
1129 {{"", "11", "9"}, 0.18},
1130 {{"", "11", "10"}, 0.14},
1131 {{"", "11", "12"}, 0.28},
1132 {{"", "11", "13"}, 0.3},
1133 {{"", "11", "14"}, 0.25},
1134 {{"", "11", "15"}, 0.18},
1135 {{"", "11", "16"}, 0.0},
1136 {{"", "11", "17"}, 0.38},
1137 {{"", "12", "1"}, 0.02},
1138 {{"", "12", "2"}, 0.27},
1139 {{"", "12", "3"}, 0.18},
1140 {{"", "12", "4"}, 0.25},
1141 {{"", "12", "5"}, 0.28},
1142 {{"", "12", "6"}, 0.04},
1143 {{"", "12", "7"}, -0.12},
1144 {{"", "12", "8"}, -0.07},
1145 {{"", "12", "9"}, -0.07},
1146 {{"", "12", "10"}, 0.11},
1147 {{"", "12", "11"}, 0.28},
1148 {{"", "12", "13"}, 0.18},
1149 {{"", "12", "14"}, 0.18},
1150 {{"", "12", "15"}, 0.08},
1151 {{"", "12", "16"}, 0.0},
1152 {{"", "12", "17"}, 0.21},
1153 {{"", "13", "1"}, 0.21},
1154 {{"", "13", "2"}, 0.31},
1155 {{"", "13", "3"}, 0.22},
1156 {{"", "13", "4"}, 0.23},
1157 {{"", "13", "5"}, 0.28},
1158 {{"", "13", "6"}, 0.11},
1159 {{"", "13", "7"}, 0.19},
1160 {{"", "13", "8"}, 0.04},
1161 {{"", "13", "9"}, 0.12},
1162 {{"", "13", "10"}, 0.11},
1163 {{"", "13", "11"}, 0.3},
1164 {{"", "13", "12"}, 0.18},
1165 {{"", "13", "14"}, 0.34},
1166 {{"", "13", "15"}, 0.16},
1167 {{"", "13", "16"}, 0.0},
1168 {{"", "13", "17"}, 0.34},
1169 {{"", "14", "1"}, 0.19},
1170 {{"", "14", "2"}, 0.29},
1171 {{"", "14", "3"}, 0.23},
1172 {{"", "14", "4"}, 0.27},
1173 {{"", "14", "5"}, 0.27},
1174 {{"", "14", "6"}, 0.1},
1175 {{"", "14", "7"}, 0.14},
1176 {{"", "14", "8"}, 0.06},
1177 {{"", "14", "9"}, 0.12},
1178 {{"", "14", "10"}, 0.1},
1179 {{"", "14", "11"}, 0.25},
1180 {{"", "14", "12"}, 0.18},
1181 {{"", "14", "13"}, 0.34},
1182 {{"", "14", "15"}, 0.13},
1183 {{"", "14", "16"}, 0.0},
1184 {{"", "14", "17"}, 0.26},
1185 {{"", "15", "1"}, 0.15},
1186 {{"", "15", "2"}, 0.21},
1187 {{"", "15", "3"}, 0.23},
1188 {{"", "15", "4"}, 0.18},
1189 {{"", "15", "5"}, 0.18},
1190 {{"", "15", "6"}, 0.09},
1191 {{"", "15", "7"}, 0.08},
1192 {{"", "15", "8"}, 0.01},
1193 {{"", "15", "9"}, 0.1},
1194 {{"", "15", "10"}, 0.07},
1195 {{"", "15", "11"}, 0.18},
1196 {{"", "15", "12"}, 0.08},
1197 {{"", "15", "13"}, 0.16},
1198 {{"", "15", "14"}, 0.13},
1199 {{"", "15", "16"}, 0.0},
1200 {{"", "15", "17"}, 0.21},
1201 {{"", "16", "1"}, 0.0},
1202 {{"", "16", "2"}, 0.0},
1203 {{"", "16", "3"}, 0.0},
1204 {{"", "16", "4"}, 0.0},
1205 {{"", "16", "5"}, 0.0},
1206 {{"", "16", "6"}, 0.0},
1207 {{"", "16", "7"}, 0.0},
1208 {{"", "16", "8"}, 0.0},
1209 {{"", "16", "9"}, 0.0},
1210 {{"", "16", "10"}, 0.0},
1211 {{"", "16", "11"}, 0.0},
1212 {{"", "16", "12"}, 0.0},
1213 {{"", "16", "13"}, 0.0},
1214 {{"", "16", "14"}, 0.0},
1215 {{"", "16", "15"}, 0.0},
1216 {{"", "16", "17"}, 0.0},
1217 {{"", "17", "1"}, 0.24},
1218 {{"", "17", "2"}, 0.6},
1219 {{"", "17", "3"}, 0.54},
1220 {{"", "17", "4"}, 0.59},
1221 {{"", "17", "5"}, 0.55},
1222 {{"", "17", "6"}, 0.24},
1223 {{"", "17", "7"}, 0.24},
1224 {{"", "17", "8"}, 0.16},
1225 {{"", "17", "9"}, 0.21},
1226 {{"", "17", "10"}, 0.14},
1227 {{"", "17", "11"}, 0.38},
1228 {{"", "17", "12"}, 0.21},
1229 {{"", "17", "13"}, 0.34},
1230 {{"", "17", "14"}, 0.26},
1231 {{"", "17", "15"}, 0.21},
1232 {{"", "17", "16"}, 0.0}
1233 };
1234
1235 // Equity intra-bucket correlations (exclude Residual and deal with it in the method - it is 0%) - changed
1236 intraBucketCorrelation_[RiskType::Equity] = {
1237 {{"1", "", ""}, 0.18},
1238 {{"2", "", ""}, 0.23},
1239 {{"3", "", ""}, 0.3},
1240 {{"4", "", ""}, 0.26},
1241 {{"5", "", ""}, 0.23},
1242 {{"6", "", ""}, 0.35},
1243 {{"7", "", ""}, 0.36},
1244 {{"8", "", ""}, 0.33},
1245 {{"9", "", ""}, 0.19},
1246 {{"10", "", ""}, 0.2},
1247 {{"11", "", ""}, 0.45},
1248 {{"12", "", ""}, 0.45}
1249 };
1250
1251 // Commodity intra-bucket correlations
1252 intraBucketCorrelation_[RiskType::Commodity] = {
1253 {{"1", "", ""}, 0.84},
1254 {{"2", "", ""}, 0.98},
1255 {{"3", "", ""}, 0.96},
1256 {{"4", "", ""}, 0.97},
1257 {{"5", "", ""}, 0.98},
1258 {{"6", "", ""}, 0.88},
1259 {{"7", "", ""}, 0.98},
1260 {{"8", "", ""}, 0.49},
1261 {{"9", "", ""}, 0.8},
1262 {{"10", "", ""}, 0.46},
1263 {{"11", "", ""}, 0.55},
1264 {{"12", "", ""}, 0.46},
1265 {{"13", "", ""}, 0.66},
1266 {{"14", "", ""}, 0.18},
1267 {{"15", "", ""}, 0.21},
1268 {{"16", "", ""}, 0},
1269 {{"17", "", ""}, 0.36}
1270 };
1271
1272 // Initialise the single, ad-hoc type, correlations
1273 xccyCorr_ = 0.01;
1274 infCorr_ = 0.37;
1275 infVolCorr_ = 0.37;
1276 irSubCurveCorr_ = 0.99;
1277 irInterCurrencyCorr_ = 0.24;
1279 crqSameIntraCorr_ = 0.93;
1280 crqDiffIntraCorr_ = 0.42;
1282 crnqSameIntraCorr_ = 0.82;
1283 crnqDiffIntraCorr_ = 0.27;
1284 crnqInterCorr_ = 0.4;
1285 fxCorr_ = 0.5;
1286 basecorrCorr_ = 0.24;
1287
1288 // clang-format on
1289}
1290
1291/* The CurvatureMargin must be multiplied by a scale factor of HVR(IR)^{-2}, where HVR(IR)
1292is the historical volatility ratio for the interest-rate risk class (see page 8 section 11(d)
1293of the ISDA-SIMM-v2.5 documentation).
1294*/
1295QuantLib::Real SimmConfiguration_ISDA_V2_5::curvatureMarginScaling() const { return pow(hvr_ir_, -2.0); }
1296
1297void SimmConfiguration_ISDA_V2_5::addLabels2(const RiskType& rt, const string& label_2) {
1298 // Call the shared implementation
1300}
1301
1302string SimmConfiguration_ISDA_V2_5::label2(const QuantLib::ext::shared_ptr<InterestRateIndex>& irIndex) const {
1303 // Special for BMA
1304 if (boost::algorithm::starts_with(irIndex->name(), "BMA")) {
1305 return "Municipal";
1306 }
1307
1308 // Otherwise pass off to base class
1309 return SimmConfigurationBase::label2(irIndex);
1310}
1311
1312} // namespace analytics
1313} // namespace ore
virtual std::string label2(const QuantLib::ext::shared_ptr< QuantLib::InterestRateIndex > &irIndex) const
QuantLib::Real correlation(const CrifRecord::RiskType &firstRt, const std::string &firstQualifier, const std::string &firstLabel_1, const std::string &firstLabel_2, const CrifRecord::RiskType &secondRt, const std::string &secondQualifier, const std::string &secondLabel_1, const std::string &secondLabel_2, const std::string &calculationCurrency="") const override
QuantLib::Real weight(const CrifRecord::RiskType &rt, boost::optional< std::string > qualifier=boost::none, boost::optional< std::string > label_1=boost::none, const std::string &calculationCurrency="") const override
SimmConfiguration_ISDA_V2_5(const QuantLib::ext::shared_ptr< SimmBucketMapper > &simmBucketMapper, const QuantLib::Size &mporDays=10, const std::string &name="SIMM ISDA 2.5 (25 June 2022)", const std::string version="2.5")
QuantLib::Matrix fxRegVolCorrelation_
FX Correlations when the calculation ccy is in the Regular Volatility group.
QuantLib::Matrix fxHighVolCorrelation_
FX Correlations when the calculation ccy is in the High Volatility group.
std::string label2(const QuantLib::ext::shared_ptr< QuantLib::InterestRateIndex > &irIndex) const override
Return the SIMM Label2 value for the given interest rate index.
void addLabels2(const CrifRecord::RiskType &rt, const std::string &label_2) override
Add SIMM Label2 values under certain circumstances.
std::map< QuantLib::Size, std::set< std::string > > ccyGroups_
QuantLib::Matrix rwFX_
FX risk weight matrix.
QuantLib::Real hvr_ir_
IR Historical volatility ratio.
QuantLib::Size group(const std::string &qualifier, const std::map< QuantLib::Size, std::set< std::string > > &groups) const
Find the group of the qualifier.
QuantLib::Real correlation(const CrifRecord::RiskType &firstRt, const std::string &firstQualifier, const std::string &firstLabel_1, const std::string &firstLabel_2, const CrifRecord::RiskType &secondRt, const std::string &secondQualifier, const std::string &secondLabel_1, const std::string &secondLabel_2, const std::string &calculationCurrency="") const override
QuantLib::Real crqResidualIntraCorr_
Credit-Q residual intra correlation.
QuantLib::Real basecorrCorr_
Base correlation risk factor correlation.
std::map< CrifRecord::RiskType, QuantLib::Real > rwRiskType_
QuantLib::Real weight(const CrifRecord::RiskType &rt, boost::optional< std::string > qualifier=boost::none, boost::optional< std::string > label_1=boost::none, const std::string &calculationCurrency="") const override
QuantLib::Real crnqResidualIntraCorr_
Credit-NonQ residual intra correlation.
QuantLib::Size mporDays() const
MPOR in days.
std::map< CrifRecord::RiskType, std::vector< std::string > > mapLabels_2_
QuantLib::Real irInterCurrencyCorr_
IR correlation across currencies.
std::map< CrifRecord::RiskType, Amounts > rwLabel_1_
std::map< CrifRecord::RiskType, Amounts > intraBucketCorrelation_
std::map< CrifRecord::RiskType, std::vector< std::string > > mapBuckets_
QuantLib::Real crnqDiffIntraCorr_
Credit-NonQ non-residual intra correlation when different underlying names.
QuantLib::Real crqSameIntraCorr_
Credit-Q non-residual intra correlation when same qualifier but different vertex/source.
QuantLib::Real crnqSameIntraCorr_
Credit-NonQ non-residual intra correlation when same underlying names.
std::set< CrifRecord::RiskType > validRiskTypes_
Set of valid risk types for the current configuration.
QuantLib::ext::shared_ptr< SimmConcentration > simmConcentration_
Used to get the concentration thresholds for a given risk type and qualifier.
QuantLib::Real infCorr_
Correlation between any yield and inflation in same currency.
Amounts riskClassCorrelation_
Risk class correlation matrix.
QuantLib::Real crnqInterCorr_
Credit-NonQ non-residual inter bucket correlation.
std::map< CrifRecord::RiskType, QuantLib::Real > historicalVolatilityRatios_
Map from risk type to a historical volatility ratio.
std::map< CrifRecord::RiskType, Amounts > interBucketCorrelation_
std::map< CrifRecord::RiskType, std::vector< std::string > > mapLabels_1_
QuantLib::Real infVolCorr_
Correlation between any yield volatility and inflation volatility in same currency.
QuantLib::Real crqDiffIntraCorr_
Credit-Q non-residual intra correlation when different qualifier.
QuantLib::Real irSubCurveCorr_
IR Label2 level i.e. sub-curve correlation.
void addLabels2Impl(const CrifRecord::RiskType &rt, const std::string &label_2)
A base implementation of addLabels2 that can be shared by derived classes.
std::map< CrifRecord::RiskType, std::vector< QuantLib::Real > > curvatureWeights_
QuantLib::ext::shared_ptr< SimmBucketMapper > simmBucketMapper_
Used to map SIMM Qualifier names to SIMM bucket values.
std::map< CrifRecord::RiskType, Amounts > rwBucket_
RandomVariable pow(RandomVariable x, const RandomVariable &y)
CrifRecord::RiskType RiskType
Definition: crifloader.cpp:92
SIMM concentration thresholds for SIMM version 2.5.
SIMM configuration for SIMM version 2.5.
string name