Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
simmconfigurationisdav2_3.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 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_3::group(const string& qualifier,
38 const std::map<QuantLib::Size, 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_3::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_3::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_3::SimmConfiguration_ISDA_V2_3(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_3>(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 (currently just BRL) & regular vol currencies (all others)
150 ccyGroups_ = {
151 { 1, { } },
152 { 0, { } },
153 };
154
155 vector<Real> temp;
156
157 if (mporDays_ == 10) {
158 // Risk weights
159 temp = {
160 7.5, 7.5,
161 7.5, 7.5
162 };
163 rwFX_ = Matrix(2, 2, temp.begin(), temp.end());
164
165 rwRiskType_ = {
166 { RiskType::Inflation, 50 },
167 { RiskType::XCcyBasis, 22 },
168 { RiskType::IRVol, 0.16 },
169 { RiskType::InflationVol, 0.16 },
170 { RiskType::CreditVol, 0.46 },
171 { RiskType::CreditVolNonQ, 0.46 },
172 { RiskType::CommodityVol, 0.41 },
173 { RiskType::FXVol, 0.30 },
174 { RiskType::BaseCorr, 12.0 }
175 };
176
177 rwBucket_ = {
178 {RiskType::CreditQ,
179 {{{"1", "", ""}, 75.0},
180 {{"2", "", ""}, 89.0},
181 {{"3", "", ""}, 68.0},
182 {{"4", "", ""}, 51.0},
183 {{"5", "", ""}, 50.0},
184 {{"6", "", ""}, 47.0},
185 {{"7", "", ""}, 157.0},
186 {{"8", "", ""}, 333.0},
187 {{"9", "", ""}, 142.0},
188 {{"10", "", ""}, 214.0},
189 {{"11", "", ""}, 143.0},
190 {{"12", "", ""}, 160.0},
191 {{"Residual", "", ""}, 333.0}}},
192 {RiskType::CreditNonQ,
193 {{{"1", "", ""}, 240.0},
194 {{"2", "", ""}, 1000.0},
195 {{"Residual", "", ""}, 1000.0}}},
196 {RiskType::Equity,
197 {{{"1", "", ""}, 23.0},
198 {{"2", "", ""}, 25.0},
199 {{"3", "", ""}, 29.0},
200 {{"4", "", ""}, 26.0},
201 {{"5", "", ""}, 20.0},
202 {{"6", "", ""}, 21.0},
203 {{"7", "", ""}, 24.0},
204 {{"8", "", ""}, 24.0},
205 {{"9", "", ""}, 29.0},
206 {{"10", "", ""}, 28.0},
207 {{"11", "", ""}, 15.0},
208 {{"12", "", ""}, 15.0},
209 {{"Residual", "", ""}, 29.0}}},
210 {RiskType::Commodity,
211 {{{"1", "", ""}, 16.0},
212 {{"2", "", ""}, 20.0},
213 {{"3", "", ""}, 23.0},
214 {{"4", "", ""}, 18.0},
215 {{"5", "", ""}, 28.0},
216 {{"6", "", ""}, 18.0},
217 {{"7", "", ""}, 17.0},
218 {{"8", "", ""}, 57.0},
219 {{"9", "", ""}, 21.0},
220 {{"10", "", ""}, 39.0},
221 {{"11", "", ""}, 20.0},
222 {{"12", "", ""}, 20.0},
223 {{"13", "", ""}, 15.0},
224 {{"14", "", ""}, 15.0},
225 {{"15", "", ""}, 11.0},
226 {{"16", "", ""}, 57.0},
227 {{"17", "", ""}, 16.0}}},
228 {RiskType::EquityVol,
229 {{{"1", "", ""}, 0.26},
230 {{"2", "", ""}, 0.26},
231 {{"3", "", ""}, 0.26},
232 {{"4", "", ""}, 0.26},
233 {{"5", "", ""}, 0.26},
234 {{"6", "", ""}, 0.26},
235 {{"7", "", ""}, 0.26},
236 {{"8", "", ""}, 0.26},
237 {{"9", "", ""}, 0.26},
238 {{"10", "", ""}, 0.26},
239 {{"11", "", ""}, 0.26},
240 {{"12", "", ""}, 0.67},
241 {{"Residual", "", ""}, 0.26}}}
242 };
243
244 rwLabel_1_ = {
245 {RiskType::IRCurve,
246 {{{"1", "2w", ""}, 114.0},
247 {{"1", "1m", ""}, 107.0},
248 {{"1", "3m", ""}, 95.0},
249 {{"1", "6m", ""}, 71.0},
250 {{"1", "1y", ""}, 56.0},
251 {{"1", "2y", ""}, 53.0},
252 {{"1", "3y", ""}, 50.0},
253 {{"1", "5y", ""}, 51.0},
254 {{"1", "10y", ""}, 53.0},
255 {{"1", "15y", ""}, 50.0},
256 {{"1", "20y", ""}, 54.0},
257 {{"1", "30y", ""}, 63.0},
258 {{"2", "2w", ""}, 15.0},
259 {{"2", "1m", ""}, 21.0},
260 {{"2", "3m", ""}, 10.0},
261 {{"2", "6m", ""}, 10.0},
262 {{"2", "1y", ""}, 11.0},
263 {{"2", "2y", ""}, 15.0},
264 {{"2", "3y", ""}, 18.0},
265 {{"2", "5y", ""}, 19.0},
266 {{"2", "10y", ""}, 19.0},
267 {{"2", "15y", ""}, 18.0},
268 {{"2", "20y", ""}, 20.0},
269 {{"2", "30y", ""}, 22.0},
270 {{"3", "2w", ""}, 103.0},
271 {{"3", "1m", ""}, 96.0},
272 {{"3", "3m", ""}, 84.0},
273 {{"3", "6m", ""}, 84.0},
274 {{"3", "1y", ""}, 89.0},
275 {{"3", "2y", ""}, 87.0},
276 {{"3", "3y", ""}, 90.0},
277 {{"3", "5y", ""}, 89.0},
278 {{"3", "10y", ""}, 90.0},
279 {{"3", "15y", ""}, 99.0},
280 {{"3", "20y", ""}, 100.0},
281 {{"3", "30y", ""}, 96.0}}
282 }
283 };
284
285 // Historical volatility ratios
286 historicalVolatilityRatios_[RiskType::EquityVol] = 0.60;
287 historicalVolatilityRatios_[RiskType::CommodityVol] = 0.75;
288 historicalVolatilityRatios_[RiskType::FXVol] = 0.58;
289 hvr_ir_ = 0.49;
290 // Curvature weights
292 { RiskType::IRVol, { 0.5,
293 0.5 * 14.0 / (365.0 / 12.0),
294 0.5 * 14.0 / (3.0 * 365.0 / 12.0),
295 0.5 * 14.0 / (6.0 * 365.0 / 12.0),
296 0.5 * 14.0 / 365.0,
297 0.5 * 14.0 / (2.0 * 365.0),
298 0.5 * 14.0 / (3.0 * 365.0),
299 0.5 * 14.0 / (5.0 * 365.0),
300 0.5 * 14.0 / (10.0 * 365.0),
301 0.5 * 14.0 / (15.0 * 365.0),
302 0.5 * 14.0 / (20.0 * 365.0),
303 0.5 * 14.0 / (30.0 * 365.0) }
304 },
305 { RiskType::CreditVol, { 0.5 * 14.0 / 365.0,
306 0.5 * 14.0 / (2.0 * 365.0),
307 0.5 * 14.0 / (3.0 * 365.0),
308 0.5 * 14.0 / (5.0 * 365.0),
309 0.5 * 14.0 / (10.0 * 365.0) }
310 }
311 };
312 curvatureWeights_[RiskType::InflationVol] = curvatureWeights_[RiskType::IRVol];
313 curvatureWeights_[RiskType::EquityVol] = curvatureWeights_[RiskType::IRVol];
314 curvatureWeights_[RiskType::CommodityVol] = curvatureWeights_[RiskType::IRVol];
315 curvatureWeights_[RiskType::FXVol] = curvatureWeights_[RiskType::IRVol];
316 curvatureWeights_[RiskType::CreditVolNonQ] = curvatureWeights_[RiskType::CreditVol];
317
318 } else {
319 // SIMM:Technical Paper, Section I.1: "All delta and vega risk weights should be replaced with the values for
320 // one-day calibration given in the Calibration Results document."
321
322 // Risk weights
323 temp = {
324 1.8, 1.8,
325 1.8, 1.8
326 };
327 rwFX_ = Matrix(2, 2, temp.begin(), temp.end());
328
329 rwRiskType_ = {
330 { RiskType::Inflation, 14.0 },
331 { RiskType::XCcyBasis, 5.4 },
332 { RiskType::IRVol, 0.042 },
333 { RiskType::InflationVol, 0.042 },
334 { RiskType::CreditVol, 0.091 },
335 { RiskType::CreditVolNonQ, 0.091 },
336 { RiskType::CommodityVol, 0.13 },
337 { RiskType::FXVol, 0.077 },
338 { RiskType::BaseCorr, 2.6 }
339 };
340
341 rwBucket_ = {
342 {RiskType::CreditQ,
343 {{{"1", "", ""}, 17.0},
344 {{"2", "", ""}, 22.0},
345 {{"3", "", ""}, 14.0},
346 {{"4", "", ""}, 11.0},
347 {{"5", "", ""}, 11.0},
348 {{"6", "", ""}, 9.5},
349 {{"7", "", ""}, 39.0},
350 {{"8", "", ""}, 63.0},
351 {{"9", "", ""}, 28.0},
352 {{"10", "", ""}, 45.0},
353 {{"11", "", ""}, 32.0},
354 {{"12", "", ""}, 35.0},
355 {{"Residual", "", ""}, 63.0}}},
356 {RiskType::CreditNonQ,
357 {{{"1", "", ""}, 83.0},
358 {{"2", "", ""}, 220.0},
359 {{"Residual", "", ""}, 220.0}}},
360 {RiskType::Equity,
361 {{{"1", "", ""}, 7.6},
362 {{"2", "", ""}, 8.1},
363 {{"3", "", ""}, 9.4},
364 {{"4", "", ""}, 8.3},
365 {{"5", "", ""}, 6.8},
366 {{"6", "", ""}, 7.4},
367 {{"7", "", ""}, 8.5},
368 {{"8", "", ""}, 8.6},
369 {{"9", "", ""}, 9.4},
370 {{"10", "", ""}, 9.3},
371 {{"11", "", ""}, 5.5},
372 {{"12", "", ""}, 5.5},
373 {{"Residual", "", ""}, 9.4}}},
374 {RiskType::Commodity,
375 {{{"1", "", ""}, 5.7},
376 {{"2", "", ""}, 7.0},
377 {{"3", "", ""}, 7.0},
378 {{"4", "", ""}, 5.5},
379 {{"5", "", ""}, 8.9},
380 {{"6", "", ""}, 6.6},
381 {{"7", "", ""}, 6.5},
382 {{"8", "", ""}, 13.0},
383 {{"9", "", ""}, 6.8},
384 {{"10", "", ""}, 13},
385 {{"11", "", ""}, 6.0},
386 {{"12", "", ""}, 5.7},
387 {{"13", "", ""}, 4.9},
388 {{"14", "", ""}, 4.6},
389 {{"15", "", ""}, 3.0},
390 {{"16", "", ""}, 13.0},
391 {{"17", "", ""}, 4.8}}},
392 {RiskType::EquityVol,
393 {{{"1", "", ""}, 0.065},
394 {{"2", "", ""}, 0.065},
395 {{"3", "", ""}, 0.065},
396 {{"4", "", ""}, 0.065},
397 {{"5", "", ""}, 0.065},
398 {{"6", "", ""}, 0.065},
399 {{"7", "", ""}, 0.065},
400 {{"8", "", ""}, 0.065},
401 {{"9", "", ""}, 0.065},
402 {{"10", "", ""}, 0.065},
403 {{"11", "", ""}, 0.065},
404 {{"12", "", ""}, 0.22},
405 {{"Residual", "", ""}, 0.065}}}
406 };
407
408 rwLabel_1_ = {
409 {RiskType::IRCurve,
410 {{{"1", "2w", ""}, 18.0},
411 {{"1", "1m", ""}, 15.0},
412 {{"1", "3m", ""}, 10.0},
413 {{"1", "6m", ""}, 11.0},
414 {{"1", "1y", ""}, 13.0},
415 {{"1", "2y", ""}, 15.0},
416 {{"1", "3y", ""}, 16.0},
417 {{"1", "5y", ""}, 16.0},
418 {{"1", "10y", ""}, 16.0},
419 {{"1", "15y", ""}, 16.0},
420 {{"1", "20y", ""}, 16.0},
421 {{"1", "30y", ""}, 17.0},
422 {{"2", "2w", ""}, 1.7},
423 {{"2", "1m", ""}, 3.4},
424 {{"2", "3m", ""}, 1.9},
425 {{"2", "6m", ""}, 1.5},
426 {{"2", "1y", ""}, 2.8},
427 {{"2", "2y", ""}, 4.5},
428 {{"2", "3y", ""}, 4.8},
429 {{"2", "5y", ""}, 6.1},
430 {{"2", "10y", ""}, 6.3},
431 {{"2", "15y", ""}, 6.8},
432 {{"2", "20y", ""}, 7.3},
433 {{"2", "30y", ""}, 7.5},
434 {{"3", "2w", ""}, 29.0},
435 {{"3", "1m", ""}, 35.0},
436 {{"3", "3m", ""}, 18.0},
437 {{"3", "6m", ""}, 20.0},
438 {{"3", "1y", ""}, 21.0},
439 {{"3", "2y", ""}, 23.0},
440 {{"3", "3y", ""}, 33.0},
441 {{"3", "5y", ""}, 32.0},
442 {{"3", "10y", ""}, 31.0},
443 {{"3", "15y", ""}, 26.0},
444 {{"3", "20y", ""}, 27.0},
445 {{"3", "30y", ""}, 26.0}}
446 }
447 };
448
449 // Historical volatility ratios
450 historicalVolatilityRatios_[RiskType::EquityVol] = 0.54;
451 historicalVolatilityRatios_[RiskType::CommodityVol] = 0.73;
452 historicalVolatilityRatios_[RiskType::FXVol] = 0.76;
453 hvr_ir_ = 0.53;
454
455 // Curvature weights
456 //SIMM:Technical Paper, Section I.3, this 10-day formula for curvature weights is modified
458 { RiskType::IRVol, { 0.5 / 10.0,
459 0.5 * 1.40 / (365.0 / 12.0),
460 0.5 * 1.40 / (3.0 * 365.0 / 12.0),
461 0.5 * 1.40 / (6.0 * 365.0 / 12.0),
462 0.5 * 1.40 / 365.0,
463 0.5 * 1.40 / (2.0 * 365.0),
464 0.5 * 1.40 / (3.0 * 365.0),
465 0.5 * 1.40 / (5.0 * 365.0),
466 0.5 * 1.40 / (10.0 * 365.0),
467 0.5 * 1.40 / (15.0 * 365.0),
468 0.5 * 1.40 / (20.0 * 365.0),
469 0.5 * 1.40 / (30.0 * 365.0) }
470 },
471 { RiskType::CreditVol, { 0.5 * 1.40 / 365.0,
472 0.5 * 1.40 / (2.0 * 365.0),
473 0.5 * 1.40 / (3.0 * 365.0),
474 0.5 * 1.40 / (5.0 * 365.0),
475 0.5 * 1.40 / (10.0 * 365.0) }
476 }
477 };
478 curvatureWeights_[RiskType::InflationVol] = curvatureWeights_[RiskType::IRVol];
479 curvatureWeights_[RiskType::EquityVol] = curvatureWeights_[RiskType::IRVol];
480 curvatureWeights_[RiskType::CommodityVol] = curvatureWeights_[RiskType::IRVol];
481 curvatureWeights_[RiskType::FXVol] = curvatureWeights_[RiskType::IRVol];
482 curvatureWeights_[RiskType::CreditVolNonQ] = curvatureWeights_[RiskType::CreditVol];
483
484 }
485
486
487 // Valid risk types
489 RiskType::Commodity,
490 RiskType::CommodityVol,
491 RiskType::CreditNonQ,
492 RiskType::CreditQ,
493 RiskType::CreditVol,
494 RiskType::CreditVolNonQ,
495 RiskType::Equity,
496 RiskType::EquityVol,
497 RiskType::FX,
498 RiskType::FXVol,
499 RiskType::Inflation,
500 RiskType::IRCurve,
501 RiskType::IRVol,
502 RiskType::InflationVol,
503 RiskType::BaseCorr,
504 RiskType::XCcyBasis,
505 RiskType::ProductClassMultiplier,
506 RiskType::AddOnNotionalFactor,
507 RiskType::PV,
508 RiskType::Notional,
509 RiskType::AddOnFixedAmount
510 };
511
512 // Risk class correlation matrix
514 {{"", "InterestRate", "CreditQualifying"}, 0.29},
515 {{"", "InterestRate", "CreditNonQualifying"}, 0.28},
516 {{"", "InterestRate", "Equity"}, 0.31},
517 {{"", "InterestRate", "Commodity"}, 0.35},
518 {{"", "InterestRate", "FX"}, 0.18},
519 {{"", "CreditQualifying", "InterestRate"}, 0.29},
520 {{"", "CreditQualifying", "CreditNonQualifying"}, 0.51},
521 {{"", "CreditQualifying", "Equity"}, 0.61},
522 {{"", "CreditQualifying", "Commodity"}, 0.43},
523 {{"", "CreditQualifying", "FX"}, 0.35},
524 {{"", "CreditNonQualifying", "InterestRate"}, 0.28},
525 {{"", "CreditNonQualifying", "CreditQualifying"}, 0.51},
526 {{"", "CreditNonQualifying", "Equity"}, 0.47},
527 {{"", "CreditNonQualifying", "Commodity"}, 0.34},
528 {{"", "CreditNonQualifying", "FX"}, 0.18},
529 {{"", "Equity", "InterestRate"}, 0.31},
530 {{"", "Equity", "CreditQualifying"}, 0.61},
531 {{"", "Equity", "CreditNonQualifying"}, 0.47},
532 {{"", "Equity", "Commodity"}, 0.47},
533 {{"", "Equity", "FX"}, 0.3},
534 {{"", "Commodity", "InterestRate"}, 0.35},
535 {{"", "Commodity", "CreditQualifying"}, 0.43},
536 {{"", "Commodity", "CreditNonQualifying"}, 0.34},
537 {{"", "Commodity", "Equity"}, 0.47},
538 {{"", "Commodity", "FX"}, 0.31},
539 {{"", "FX", "InterestRate"}, 0.18},
540 {{"", "FX", "CreditQualifying"}, 0.35},
541 {{"", "FX", "CreditNonQualifying"}, 0.18},
542 {{"", "FX", "Equity"}, 0.3},
543 {{"", "FX", "Commodity"}, 0.31},
544 };
545
546 // FX correlations
547 temp = {
548 0.500, 0.500,
549 0.500, 0.500
550 };
551 fxRegVolCorrelation_ = Matrix(2, 2, temp.begin(), temp.end());
552
553 temp = {
554 0.500, 0.500,
555 0.500, 0.500
556 };
557 fxHighVolCorrelation_ = Matrix(2, 2, temp.begin(), temp.end());
558
559 // Interest rate tenor correlations (i.e. Label1 level correlations)
560 intraBucketCorrelation_[RiskType::IRCurve] = {
561 {{"", "2w", "1m"}, 0.73},
562 {{"", "2w", "3m"}, 0.64},
563 {{"", "2w", "6m"}, 0.57},
564 {{"", "2w", "1y"}, 0.44},
565 {{"", "2w", "2y"}, 0.34},
566 {{"", "2w", "3y"}, 0.29},
567 {{"", "2w", "5y"}, 0.24},
568 {{"", "2w", "10y"}, 0.18},
569 {{"", "2w", "15y"}, 0.13},
570 {{"", "2w", "20y"}, 0.11},
571 {{"", "2w", "30y"}, 0.09},
572 {{"", "1m", "2w"}, 0.73},
573 {{"", "1m", "3m"}, 0.78},
574 {{"", "1m", "6m"}, 0.67},
575 {{"", "1m", "1y"}, 0.5},
576 {{"", "1m", "2y"}, 0.37},
577 {{"", "1m", "3y"}, 0.3},
578 {{"", "1m", "5y"}, 0.24},
579 {{"", "1m", "10y"}, 0.18},
580 {{"", "1m", "15y"}, 0.13},
581 {{"", "1m", "20y"}, 0.11},
582 {{"", "1m", "30y"}, 0.1},
583 {{"", "3m", "2w"}, 0.64},
584 {{"", "3m", "1m"}, 0.78},
585 {{"", "3m", "6m"}, 0.85},
586 {{"", "3m", "1y"}, 0.66},
587 {{"", "3m", "2y"}, 0.52},
588 {{"", "3m", "3y"}, 0.43},
589 {{"", "3m", "5y"}, 0.35},
590 {{"", "3m", "10y"}, 0.27},
591 {{"", "3m", "15y"}, 0.2},
592 {{"", "3m", "20y"}, 0.17},
593 {{"", "3m", "30y"}, 0.17},
594 {{"", "6m", "2w"}, 0.57},
595 {{"", "6m", "1m"}, 0.67},
596 {{"", "6m", "3m"}, 0.85},
597 {{"", "6m", "1y"}, 0.81},
598 {{"", "6m", "2y"}, 0.68},
599 {{"", "6m", "3y"}, 0.59},
600 {{"", "6m", "5y"}, 0.5},
601 {{"", "6m", "10y"}, 0.41},
602 {{"", "6m", "15y"}, 0.35},
603 {{"", "6m", "20y"}, 0.33},
604 {{"", "6m", "30y"}, 0.31},
605 {{"", "1y", "2w"}, 0.44},
606 {{"", "1y", "1m"}, 0.5},
607 {{"", "1y", "3m"}, 0.66},
608 {{"", "1y", "6m"}, 0.81},
609 {{"", "1y", "2y"}, 0.94},
610 {{"", "1y", "3y"}, 0.85},
611 {{"", "1y", "5y"}, 0.76},
612 {{"", "1y", "10y"}, 0.65},
613 {{"", "1y", "15y"}, 0.59},
614 {{"", "1y", "20y"}, 0.56},
615 {{"", "1y", "30y"}, 0.54},
616 {{"", "2y", "2w"}, 0.34},
617 {{"", "2y", "1m"}, 0.37},
618 {{"", "2y", "3m"}, 0.52},
619 {{"", "2y", "6m"}, 0.68},
620 {{"", "2y", "1y"}, 0.94},
621 {{"", "2y", "3y"}, 0.95},
622 {{"", "2y", "5y"}, 0.89},
623 {{"", "2y", "10y"}, 0.79},
624 {{"", "2y", "15y"}, 0.75},
625 {{"", "2y", "20y"}, 0.72},
626 {{"", "2y", "30y"}, 0.7},
627 {{"", "3y", "2w"}, 0.29},
628 {{"", "3y", "1m"}, 0.3},
629 {{"", "3y", "3m"}, 0.43},
630 {{"", "3y", "6m"}, 0.59},
631 {{"", "3y", "1y"}, 0.85},
632 {{"", "3y", "2y"}, 0.95},
633 {{"", "3y", "5y"}, 0.96},
634 {{"", "3y", "10y"}, 0.88},
635 {{"", "3y", "15y"}, 0.83},
636 {{"", "3y", "20y"}, 0.8},
637 {{"", "3y", "30y"}, 0.78},
638 {{"", "5y", "2w"}, 0.24},
639 {{"", "5y", "1m"}, 0.24},
640 {{"", "5y", "3m"}, 0.35},
641 {{"", "5y", "6m"}, 0.5},
642 {{"", "5y", "1y"}, 0.76},
643 {{"", "5y", "2y"}, 0.89},
644 {{"", "5y", "3y"}, 0.96},
645 {{"", "5y", "10y"}, 0.95},
646 {{"", "5y", "15y"}, 0.91},
647 {{"", "5y", "20y"}, 0.88},
648 {{"", "5y", "30y"}, 0.87},
649 {{"", "10y", "2w"}, 0.18},
650 {{"", "10y", "1m"}, 0.18},
651 {{"", "10y", "3m"}, 0.27},
652 {{"", "10y", "6m"}, 0.41},
653 {{"", "10y", "1y"}, 0.65},
654 {{"", "10y", "2y"}, 0.79},
655 {{"", "10y", "3y"}, 0.88},
656 {{"", "10y", "5y"}, 0.95},
657 {{"", "10y", "15y"}, 0.97},
658 {{"", "10y", "20y"}, 0.95},
659 {{"", "10y", "30y"}, 0.95},
660 {{"", "15y", "2w"}, 0.13},
661 {{"", "15y", "1m"}, 0.13},
662 {{"", "15y", "3m"}, 0.2},
663 {{"", "15y", "6m"}, 0.35},
664 {{"", "15y", "1y"}, 0.59},
665 {{"", "15y", "2y"}, 0.75},
666 {{"", "15y", "3y"}, 0.83},
667 {{"", "15y", "5y"}, 0.91},
668 {{"", "15y", "10y"}, 0.97},
669 {{"", "15y", "20y"}, 0.98},
670 {{"", "15y", "30y"}, 0.98},
671 {{"", "20y", "2w"}, 0.11},
672 {{"", "20y", "1m"}, 0.11},
673 {{"", "20y", "3m"}, 0.17},
674 {{"", "20y", "6m"}, 0.33},
675 {{"", "20y", "1y"}, 0.56},
676 {{"", "20y", "2y"}, 0.72},
677 {{"", "20y", "3y"}, 0.8},
678 {{"", "20y", "5y"}, 0.88},
679 {{"", "20y", "10y"}, 0.95},
680 {{"", "20y", "15y"}, 0.98},
681 {{"", "20y", "30y"}, 0.99},
682 {{"", "30y", "2w"}, 0.09},
683 {{"", "30y", "1m"}, 0.1},
684 {{"", "30y", "3m"}, 0.17},
685 {{"", "30y", "6m"}, 0.31},
686 {{"", "30y", "1y"}, 0.54},
687 {{"", "30y", "2y"}, 0.7},
688 {{"", "30y", "3y"}, 0.78},
689 {{"", "30y", "5y"}, 0.87},
690 {{"", "30y", "10y"}, 0.95},
691 {{"", "30y", "15y"}, 0.98},
692 {{"", "30y", "20y"}, 0.99}
693 };
694
695 // CreditQ inter-bucket correlations
696 interBucketCorrelation_[RiskType::CreditQ] = {
697 {{"", "1", "2"}, 0.39},
698 {{"", "1", "3"}, 0.39},
699 {{"", "1", "4"}, 0.4},
700 {{"", "1", "5"}, 0.4},
701 {{"", "1", "6"}, 0.37},
702 {{"", "1", "7"}, 0.39},
703 {{"", "1", "8"}, 0.32},
704 {{"", "1", "9"}, 0.35},
705 {{"", "1", "10"}, 0.33},
706 {{"", "1", "11"}, 0.33},
707 {{"", "1", "12"}, 0.3},
708 {{"", "2", "1"}, 0.39},
709 {{"", "2", "3"}, 0.43},
710 {{"", "2", "4"}, 0.45},
711 {{"", "2", "5"}, 0.45},
712 {{"", "2", "6"}, 0.43},
713 {{"", "2", "7"}, 0.32},
714 {{"", "2", "8"}, 0.34},
715 {{"", "2", "9"}, 0.39},
716 {{"", "2", "10"}, 0.36},
717 {{"", "2", "11"}, 0.36},
718 {{"", "2", "12"}, 0.31},
719 {{"", "3", "1"}, 0.39},
720 {{"", "3", "2"}, 0.43},
721 {{"", "3", "4"}, 0.47},
722 {{"", "3", "5"}, 0.48},
723 {{"", "3", "6"}, 0.45},
724 {{"", "3", "7"}, 0.33},
725 {{"", "3", "8"}, 0.33},
726 {{"", "3", "9"}, 0.41},
727 {{"", "3", "10"}, 0.38},
728 {{"", "3", "11"}, 0.39},
729 {{"", "3", "12"}, 0.35},
730 {{"", "4", "1"}, 0.4},
731 {{"", "4", "2"}, 0.45},
732 {{"", "4", "3"}, 0.47},
733 {{"", "4", "5"}, 0.49},
734 {{"", "4", "6"}, 0.47},
735 {{"", "4", "7"}, 0.33},
736 {{"", "4", "8"}, 0.34},
737 {{"", "4", "9"}, 0.41},
738 {{"", "4", "10"}, 0.4},
739 {{"", "4", "11"}, 0.39},
740 {{"", "4", "12"}, 0.34},
741 {{"", "5", "1"}, 0.4},
742 {{"", "5", "2"}, 0.45},
743 {{"", "5", "3"}, 0.48},
744 {{"", "5", "4"}, 0.49},
745 {{"", "5", "6"}, 0.48},
746 {{"", "5", "7"}, 0.33},
747 {{"", "5", "8"}, 0.34},
748 {{"", "5", "9"}, 0.41},
749 {{"", "5", "10"}, 0.39},
750 {{"", "5", "11"}, 0.4},
751 {{"", "5", "12"}, 0.34},
752 {{"", "6", "1"}, 0.37},
753 {{"", "6", "2"}, 0.43},
754 {{"", "6", "3"}, 0.45},
755 {{"", "6", "4"}, 0.47},
756 {{"", "6", "5"}, 0.48},
757 {{"", "6", "7"}, 0.31},
758 {{"", "6", "8"}, 0.32},
759 {{"", "6", "9"}, 0.38},
760 {{"", "6", "10"}, 0.36},
761 {{"", "6", "11"}, 0.37},
762 {{"", "6", "12"}, 0.32},
763 {{"", "7", "1"}, 0.39},
764 {{"", "7", "2"}, 0.32},
765 {{"", "7", "3"}, 0.33},
766 {{"", "7", "4"}, 0.33},
767 {{"", "7", "5"}, 0.33},
768 {{"", "7", "6"}, 0.31},
769 {{"", "7", "8"}, 0.26},
770 {{"", "7", "9"}, 0.31},
771 {{"", "7", "10"}, 0.28},
772 {{"", "7", "11"}, 0.27},
773 {{"", "7", "12"}, 0.25},
774 {{"", "8", "1"}, 0.32},
775 {{"", "8", "2"}, 0.34},
776 {{"", "8", "3"}, 0.33},
777 {{"", "8", "4"}, 0.34},
778 {{"", "8", "5"}, 0.34},
779 {{"", "8", "6"}, 0.32},
780 {{"", "8", "7"}, 0.26},
781 {{"", "8", "9"}, 0.31},
782 {{"", "8", "10"}, 0.28},
783 {{"", "8", "11"}, 0.28},
784 {{"", "8", "12"}, 0.25},
785 {{"", "9", "1"}, 0.35},
786 {{"", "9", "2"}, 0.39},
787 {{"", "9", "3"}, 0.41},
788 {{"", "9", "4"}, 0.41},
789 {{"", "9", "5"}, 0.41},
790 {{"", "9", "6"}, 0.38},
791 {{"", "9", "7"}, 0.31},
792 {{"", "9", "8"}, 0.31},
793 {{"", "9", "10"}, 0.35},
794 {{"", "9", "11"}, 0.34},
795 {{"", "9", "12"}, 0.32},
796 {{"", "10", "1"}, 0.33},
797 {{"", "10", "2"}, 0.36},
798 {{"", "10", "3"}, 0.38},
799 {{"", "10", "4"}, 0.4},
800 {{"", "10", "5"}, 0.39},
801 {{"", "10", "6"}, 0.36},
802 {{"", "10", "7"}, 0.28},
803 {{"", "10", "8"}, 0.28},
804 {{"", "10", "9"}, 0.35},
805 {{"", "10", "11"}, 0.34},
806 {{"", "10", "12"}, 0.29},
807 {{"", "11", "1"}, 0.33},
808 {{"", "11", "2"}, 0.36},
809 {{"", "11", "3"}, 0.39},
810 {{"", "11", "4"}, 0.39},
811 {{"", "11", "5"}, 0.4},
812 {{"", "11", "6"}, 0.37},
813 {{"", "11", "7"}, 0.27},
814 {{"", "11", "8"}, 0.28},
815 {{"", "11", "9"}, 0.34},
816 {{"", "11", "10"}, 0.34},
817 {{"", "11", "12"}, 0.3},
818 {{"", "12", "1"}, 0.3},
819 {{"", "12", "2"}, 0.31},
820 {{"", "12", "3"}, 0.35},
821 {{"", "12", "4"}, 0.34},
822 {{"", "12", "5"}, 0.34},
823 {{"", "12", "6"}, 0.32},
824 {{"", "12", "7"}, 0.25},
825 {{"", "12", "8"}, 0.25},
826 {{"", "12", "9"}, 0.32},
827 {{"", "12", "10"}, 0.29},
828 {{"", "12", "11"}, 0.3}
829 };
830
831 // Equity inter-bucket correlations
832 interBucketCorrelation_[RiskType::Equity] = {
833 {{"", "1", "2"}, 0.17},
834 {{"", "1", "3"}, 0.18},
835 {{"", "1", "4"}, 0.17},
836 {{"", "1", "5"}, 0.11},
837 {{"", "1", "6"}, 0.15},
838 {{"", "1", "7"}, 0.15},
839 {{"", "1", "8"}, 0.15},
840 {{"", "1", "9"}, 0.15},
841 {{"", "1", "10"}, 0.11},
842 {{"", "1", "11"}, 0.19},
843 {{"", "1", "12"}, 0.19},
844 {{"", "2", "1"}, 0.17},
845 {{"", "2", "3"}, 0.23},
846 {{"", "2", "4"}, 0.21},
847 {{"", "2", "5"}, 0.13},
848 {{"", "2", "6"}, 0.17},
849 {{"", "2", "7"}, 0.18},
850 {{"", "2", "8"}, 0.17},
851 {{"", "2", "9"}, 0.19},
852 {{"", "2", "10"}, 0.13},
853 {{"", "2", "11"}, 0.22},
854 {{"", "2", "12"}, 0.22},
855 {{"", "3", "1"}, 0.18},
856 {{"", "3", "2"}, 0.23},
857 {{"", "3", "4"}, 0.24},
858 {{"", "3", "5"}, 0.14},
859 {{"", "3", "6"}, 0.19},
860 {{"", "3", "7"}, 0.22},
861 {{"", "3", "8"}, 0.19},
862 {{"", "3", "9"}, 0.2},
863 {{"", "3", "10"}, 0.15},
864 {{"", "3", "11"}, 0.25},
865 {{"", "3", "12"}, 0.25},
866 {{"", "4", "1"}, 0.17},
867 {{"", "4", "2"}, 0.21},
868 {{"", "4", "3"}, 0.24},
869 {{"", "4", "5"}, 0.14},
870 {{"", "4", "6"}, 0.19},
871 {{"", "4", "7"}, 0.2},
872 {{"", "4", "8"}, 0.19},
873 {{"", "4", "9"}, 0.2},
874 {{"", "4", "10"}, 0.15},
875 {{"", "4", "11"}, 0.24},
876 {{"", "4", "12"}, 0.24},
877 {{"", "5", "1"}, 0.11},
878 {{"", "5", "2"}, 0.13},
879 {{"", "5", "3"}, 0.14},
880 {{"", "5", "4"}, 0.14},
881 {{"", "5", "6"}, 0.22},
882 {{"", "5", "7"}, 0.21},
883 {{"", "5", "8"}, 0.22},
884 {{"", "5", "9"}, 0.13},
885 {{"", "5", "10"}, 0.16},
886 {{"", "5", "11"}, 0.24},
887 {{"", "5", "12"}, 0.24},
888 {{"", "6", "1"}, 0.15},
889 {{"", "6", "2"}, 0.17},
890 {{"", "6", "3"}, 0.19},
891 {{"", "6", "4"}, 0.19},
892 {{"", "6", "5"}, 0.22},
893 {{"", "6", "7"}, 0.29},
894 {{"", "6", "8"}, 0.29},
895 {{"", "6", "9"}, 0.17},
896 {{"", "6", "10"}, 0.21},
897 {{"", "6", "11"}, 0.32},
898 {{"", "6", "12"}, 0.32},
899 {{"", "7", "1"}, 0.15},
900 {{"", "7", "2"}, 0.18},
901 {{"", "7", "3"}, 0.22},
902 {{"", "7", "4"}, 0.2},
903 {{"", "7", "5"}, 0.21},
904 {{"", "7", "6"}, 0.29},
905 {{"", "7", "8"}, 0.28},
906 {{"", "7", "9"}, 0.17},
907 {{"", "7", "10"}, 0.21},
908 {{"", "7", "11"}, 0.34},
909 {{"", "7", "12"}, 0.34},
910 {{"", "8", "1"}, 0.15},
911 {{"", "8", "2"}, 0.17},
912 {{"", "8", "3"}, 0.19},
913 {{"", "8", "4"}, 0.19},
914 {{"", "8", "5"}, 0.22},
915 {{"", "8", "6"}, 0.29},
916 {{"", "8", "7"}, 0.28},
917 {{"", "8", "9"}, 0.17},
918 {{"", "8", "10"}, 0.21},
919 {{"", "8", "11"}, 0.33},
920 {{"", "8", "12"}, 0.33},
921 {{"", "9", "1"}, 0.15},
922 {{"", "9", "2"}, 0.19},
923 {{"", "9", "3"}, 0.2},
924 {{"", "9", "4"}, 0.2},
925 {{"", "9", "5"}, 0.13},
926 {{"", "9", "6"}, 0.17},
927 {{"", "9", "7"}, 0.17},
928 {{"", "9", "8"}, 0.17},
929 {{"", "9", "10"}, 0.13},
930 {{"", "9", "11"}, 0.21},
931 {{"", "9", "12"}, 0.21},
932 {{"", "10", "1"}, 0.11},
933 {{"", "10", "2"}, 0.13},
934 {{"", "10", "3"}, 0.15},
935 {{"", "10", "4"}, 0.15},
936 {{"", "10", "5"}, 0.16},
937 {{"", "10", "6"}, 0.21},
938 {{"", "10", "7"}, 0.21},
939 {{"", "10", "8"}, 0.21},
940 {{"", "10", "9"}, 0.13},
941 {{"", "10", "11"}, 0.22},
942 {{"", "10", "12"}, 0.22},
943 {{"", "11", "1"}, 0.19},
944 {{"", "11", "2"}, 0.22},
945 {{"", "11", "3"}, 0.25},
946 {{"", "11", "4"}, 0.24},
947 {{"", "11", "5"}, 0.24},
948 {{"", "11", "6"}, 0.32},
949 {{"", "11", "7"}, 0.34},
950 {{"", "11", "8"}, 0.33},
951 {{"", "11", "9"}, 0.21},
952 {{"", "11", "10"}, 0.22},
953 {{"", "11", "12"}, 0.41},
954 {{"", "12", "1"}, 0.19},
955 {{"", "12", "2"}, 0.22},
956 {{"", "12", "3"}, 0.25},
957 {{"", "12", "4"}, 0.24},
958 {{"", "12", "5"}, 0.24},
959 {{"", "12", "6"}, 0.32},
960 {{"", "12", "7"}, 0.34},
961 {{"", "12", "8"}, 0.33},
962 {{"", "12", "9"}, 0.21},
963 {{"", "12", "10"}, 0.22},
964 {{"", "12", "11"}, 0.41}
965 };
966
967 // Commodity inter-bucket correlations
968 interBucketCorrelation_[RiskType::Commodity] = {
969 {{"", "1", "2"}, 0.15},
970 {{"", "1", "3"}, 0.15},
971 {{"", "1", "4"}, 0.21},
972 {{"", "1", "5"}, 0.16},
973 {{"", "1", "6"}, 0.03},
974 {{"", "1", "7"}, 0.11},
975 {{"", "1", "8"}, 0.02},
976 {{"", "1", "9"}, 0.12},
977 {{"", "1", "10"}, 0.15},
978 {{"", "1", "11"}, 0.15},
979 {{"", "1", "12"}, 0.06},
980 {{"", "1", "13"}, 0.0},
981 {{"", "1", "14"}, 0.04},
982 {{"", "1", "15"}, 0.06},
983 {{"", "1", "16"}, 0.0},
984 {{"", "1", "17"}, 0.11},
985 {{"", "2", "1"}, 0.15},
986 {{"", "2", "3"}, 0.74},
987 {{"", "2", "4"}, 0.92},
988 {{"", "2", "5"}, 0.89},
989 {{"", "2", "6"}, 0.34},
990 {{"", "2", "7"}, 0.23},
991 {{"", "2", "8"}, 0.16},
992 {{"", "2", "9"}, 0.22},
993 {{"", "2", "10"}, 0.26},
994 {{"", "2", "11"}, 0.31},
995 {{"", "2", "12"}, 0.32},
996 {{"", "2", "13"}, 0.22},
997 {{"", "2", "14"}, 0.25},
998 {{"", "2", "15"}, 0.19},
999 {{"", "2", "16"}, 0.0},
1000 {{"", "2", "17"}, 0.57},
1001 {{"", "3", "1"}, 0.15},
1002 {{"", "3", "2"}, 0.74},
1003 {{"", "3", "4"}, 0.73},
1004 {{"", "3", "5"}, 0.69},
1005 {{"", "3", "6"}, 0.15},
1006 {{"", "3", "7"}, 0.22},
1007 {{"", "3", "8"}, 0.08},
1008 {{"", "3", "9"}, 0.14},
1009 {{"", "3", "10"}, 0.16},
1010 {{"", "3", "11"}, 0.21},
1011 {{"", "3", "12"}, 0.15},
1012 {{"", "3", "13"}, -0.03},
1013 {{"", "3", "14"}, 0.16},
1014 {{"", "3", "15"}, 0.14},
1015 {{"", "3", "16"}, 0.0},
1016 {{"", "3", "17"}, 0.42},
1017 {{"", "4", "1"}, 0.21},
1018 {{"", "4", "2"}, 0.92},
1019 {{"", "4", "3"}, 0.73},
1020 {{"", "4", "5"}, 0.83},
1021 {{"", "4", "6"}, 0.3},
1022 {{"", "4", "7"}, 0.26},
1023 {{"", "4", "8"}, 0.07},
1024 {{"", "4", "9"}, 0.19},
1025 {{"", "4", "10"}, 0.22},
1026 {{"", "4", "11"}, 0.28},
1027 {{"", "4", "12"}, 0.31},
1028 {{"", "4", "13"}, 0.13},
1029 {{"", "4", "14"}, 0.22},
1030 {{"", "4", "15"}, 0.11},
1031 {{"", "4", "16"}, 0.0},
1032 {{"", "4", "17"}, 0.48},
1033 {{"", "5", "1"}, 0.16},
1034 {{"", "5", "2"}, 0.89},
1035 {{"", "5", "3"}, 0.69},
1036 {{"", "5", "4"}, 0.83},
1037 {{"", "5", "6"}, 0.12},
1038 {{"", "5", "7"}, 0.14},
1039 {{"", "5", "8"}, 0.0},
1040 {{"", "5", "9"}, 0.06},
1041 {{"", "5", "10"}, 0.1},
1042 {{"", "5", "11"}, 0.24},
1043 {{"", "5", "12"}, 0.2},
1044 {{"", "5", "13"}, 0.06},
1045 {{"", "5", "14"}, 0.2},
1046 {{"", "5", "15"}, 0.09},
1047 {{"", "5", "16"}, 0.0},
1048 {{"", "5", "17"}, 0.49},
1049 {{"", "6", "1"}, 0.03},
1050 {{"", "6", "2"}, 0.34},
1051 {{"", "6", "3"}, 0.15},
1052 {{"", "6", "4"}, 0.3},
1053 {{"", "6", "5"}, 0.12},
1054 {{"", "6", "7"}, 0.25},
1055 {{"", "6", "8"}, 0.58},
1056 {{"", "6", "9"}, 0.21},
1057 {{"", "6", "10"}, 0.14},
1058 {{"", "6", "11"}, 0.23},
1059 {{"", "6", "12"}, 0.15},
1060 {{"", "6", "13"}, 0.25},
1061 {{"", "6", "14"}, 0.15},
1062 {{"", "6", "15"}, 0.12},
1063 {{"", "6", "16"}, 0.0},
1064 {{"", "6", "17"}, 0.37},
1065 {{"", "7", "1"}, 0.11},
1066 {{"", "7", "2"}, 0.23},
1067 {{"", "7", "3"}, 0.22},
1068 {{"", "7", "4"}, 0.26},
1069 {{"", "7", "5"}, 0.14},
1070 {{"", "7", "6"}, 0.25},
1071 {{"", "7", "8"}, 0.19},
1072 {{"", "7", "9"}, 0.64},
1073 {{"", "7", "10"}, 0.19},
1074 {{"", "7", "11"}, 0.03},
1075 {{"", "7", "12"}, -0.03},
1076 {{"", "7", "13"}, 0.04},
1077 {{"", "7", "14"}, 0.05},
1078 {{"", "7", "15"}, 0.06},
1079 {{"", "7", "16"}, 0.0},
1080 {{"", "7", "17"}, 0.17},
1081 {{"", "8", "1"}, 0.02},
1082 {{"", "8", "2"}, 0.16},
1083 {{"", "8", "3"}, 0.08},
1084 {{"", "8", "4"}, 0.07},
1085 {{"", "8", "5"}, 0.0},
1086 {{"", "8", "6"}, 0.58},
1087 {{"", "8", "7"}, 0.19},
1088 {{"", "8", "9"}, 0.17},
1089 {{"", "8", "10"}, -0.01},
1090 {{"", "8", "11"}, 0.08},
1091 {{"", "8", "12"}, 0.01},
1092 {{"", "8", "13"}, 0.11},
1093 {{"", "8", "14"}, 0.08},
1094 {{"", "8", "15"}, 0.08},
1095 {{"", "8", "16"}, 0.0},
1096 {{"", "8", "17"}, 0.15},
1097 {{"", "9", "1"}, 0.12},
1098 {{"", "9", "2"}, 0.22},
1099 {{"", "9", "3"}, 0.14},
1100 {{"", "9", "4"}, 0.19},
1101 {{"", "9", "5"}, 0.06},
1102 {{"", "9", "6"}, 0.21},
1103 {{"", "9", "7"}, 0.64},
1104 {{"", "9", "8"}, 0.17},
1105 {{"", "9", "10"}, 0.1},
1106 {{"", "9", "11"}, 0.05},
1107 {{"", "9", "12"}, -0.04},
1108 {{"", "9", "13"}, 0.05},
1109 {{"", "9", "14"}, 0.03},
1110 {{"", "9", "15"}, 0.05},
1111 {{"", "9", "16"}, 0.0},
1112 {{"", "9", "17"}, 0.17},
1113 {{"", "10", "1"}, 0.15},
1114 {{"", "10", "2"}, 0.26},
1115 {{"", "10", "3"}, 0.16},
1116 {{"", "10", "4"}, 0.22},
1117 {{"", "10", "5"}, 0.1},
1118 {{"", "10", "6"}, 0.14},
1119 {{"", "10", "7"}, 0.19},
1120 {{"", "10", "8"}, -0.01},
1121 {{"", "10", "9"}, 0.1},
1122 {{"", "10", "11"}, 0.12},
1123 {{"", "10", "12"}, 0.13},
1124 {{"", "10", "13"}, 0.12},
1125 {{"", "10", "14"}, 0.1},
1126 {{"", "10", "15"}, 0.12},
1127 {{"", "10", "16"}, 0.0},
1128 {{"", "10", "17"}, 0.17},
1129 {{"", "11", "1"}, 0.15},
1130 {{"", "11", "2"}, 0.31},
1131 {{"", "11", "3"}, 0.21},
1132 {{"", "11", "4"}, 0.28},
1133 {{"", "11", "5"}, 0.24},
1134 {{"", "11", "6"}, 0.23},
1135 {{"", "11", "7"}, 0.03},
1136 {{"", "11", "8"}, 0.08},
1137 {{"", "11", "9"}, 0.05},
1138 {{"", "11", "10"}, 0.12},
1139 {{"", "11", "12"}, 0.34},
1140 {{"", "11", "13"}, 0.23},
1141 {{"", "11", "14"}, 0.17},
1142 {{"", "11", "15"}, 0.14},
1143 {{"", "11", "16"}, 0.0},
1144 {{"", "11", "17"}, 0.3},
1145 {{"", "12", "1"}, 0.06},
1146 {{"", "12", "2"}, 0.32},
1147 {{"", "12", "3"}, 0.15},
1148 {{"", "12", "4"}, 0.31},
1149 {{"", "12", "5"}, 0.2},
1150 {{"", "12", "6"}, 0.15},
1151 {{"", "12", "7"}, -0.03},
1152 {{"", "12", "8"}, 0.01},
1153 {{"", "12", "9"}, -0.04},
1154 {{"", "12", "10"}, 0.13},
1155 {{"", "12", "11"}, 0.34},
1156 {{"", "12", "13"}, 0.15},
1157 {{"", "12", "14"}, 0.19},
1158 {{"", "12", "15"}, 0.11},
1159 {{"", "12", "16"}, 0.0},
1160 {{"", "12", "17"}, 0.27},
1161 {{"", "13", "1"}, 0.0},
1162 {{"", "13", "2"}, 0.22},
1163 {{"", "13", "3"}, -0.03},
1164 {{"", "13", "4"}, 0.13},
1165 {{"", "13", "5"}, 0.06},
1166 {{"", "13", "6"}, 0.25},
1167 {{"", "13", "7"}, 0.04},
1168 {{"", "13", "8"}, 0.11},
1169 {{"", "13", "9"}, 0.05},
1170 {{"", "13", "10"}, 0.12},
1171 {{"", "13", "11"}, 0.23},
1172 {{"", "13", "12"}, 0.15},
1173 {{"", "13", "14"}, 0.26},
1174 {{"", "13", "15"}, 0.14},
1175 {{"", "13", "16"}, 0.0},
1176 {{"", "13", "17"}, 0.26},
1177 {{"", "14", "1"}, 0.04},
1178 {{"", "14", "2"}, 0.25},
1179 {{"", "14", "3"}, 0.16},
1180 {{"", "14", "4"}, 0.22},
1181 {{"", "14", "5"}, 0.2},
1182 {{"", "14", "6"}, 0.15},
1183 {{"", "14", "7"}, 0.05},
1184 {{"", "14", "8"}, 0.08},
1185 {{"", "14", "9"}, 0.03},
1186 {{"", "14", "10"}, 0.1},
1187 {{"", "14", "11"}, 0.17},
1188 {{"", "14", "12"}, 0.19},
1189 {{"", "14", "13"}, 0.26},
1190 {{"", "14", "15"}, 0.1},
1191 {{"", "14", "16"}, 0.0},
1192 {{"", "14", "17"}, 0.22},
1193 {{"", "15", "1"}, 0.06},
1194 {{"", "15", "2"}, 0.19},
1195 {{"", "15", "3"}, 0.14},
1196 {{"", "15", "4"}, 0.11},
1197 {{"", "15", "5"}, 0.09},
1198 {{"", "15", "6"}, 0.12},
1199 {{"", "15", "7"}, 0.06},
1200 {{"", "15", "8"}, 0.08},
1201 {{"", "15", "9"}, 0.05},
1202 {{"", "15", "10"}, 0.12},
1203 {{"", "15", "11"}, 0.14},
1204 {{"", "15", "12"}, 0.11},
1205 {{"", "15", "13"}, 0.14},
1206 {{"", "15", "14"}, 0.1},
1207 {{"", "15", "16"}, 0.0},
1208 {{"", "15", "17"}, 0.2},
1209 {{"", "16", "1"}, 0.0},
1210 {{"", "16", "2"}, 0.0},
1211 {{"", "16", "3"}, 0.0},
1212 {{"", "16", "4"}, 0.0},
1213 {{"", "16", "5"}, 0.0},
1214 {{"", "16", "6"}, 0.0},
1215 {{"", "16", "7"}, 0.0},
1216 {{"", "16", "8"}, 0.0},
1217 {{"", "16", "9"}, 0.0},
1218 {{"", "16", "10"}, 0.0},
1219 {{"", "16", "11"}, 0.0},
1220 {{"", "16", "12"}, 0.0},
1221 {{"", "16", "13"}, 0.0},
1222 {{"", "16", "14"}, 0.0},
1223 {{"", "16", "15"}, 0.0},
1224 {{"", "16", "17"}, 0.0},
1225 {{"", "17", "1"}, 0.11},
1226 {{"", "17", "2"}, 0.57},
1227 {{"", "17", "3"}, 0.42},
1228 {{"", "17", "4"}, 0.48},
1229 {{"", "17", "5"}, 0.49},
1230 {{"", "17", "6"}, 0.37},
1231 {{"", "17", "7"}, 0.17},
1232 {{"", "17", "8"}, 0.15},
1233 {{"", "17", "9"}, 0.17},
1234 {{"", "17", "10"}, 0.17},
1235 {{"", "17", "11"}, 0.3},
1236 {{"", "17", "12"}, 0.27},
1237 {{"", "17", "13"}, 0.26},
1238 {{"", "17", "14"}, 0.22},
1239 {{"", "17", "15"}, 0.2},
1240 {{"", "17", "16"}, 0.0}
1241 };
1242
1243 // Equity intra-bucket correlations (exclude Residual and deal with it in the method - it is 0%) - changed
1244 intraBucketCorrelation_[RiskType::Equity] = {
1245 {{"1", "", ""}, 0.14},
1246 {{"2", "", ""}, 0.20},
1247 {{"3", "", ""}, 0.28},
1248 {{"4", "", ""}, 0.23},
1249 {{"5", "", ""}, 0.18},
1250 {{"6", "", ""}, 0.29},
1251 {{"7", "", ""}, 0.34},
1252 {{"8", "", ""}, 0.30},
1253 {{"9", "", ""}, 0.19},
1254 {{"10", "", ""}, 0.17},
1255 {{"11", "", ""}, 0.41},
1256 {{"12", "", ""}, 0.41}
1257 };
1258
1259 // Commodity intra-bucket correlations
1260 intraBucketCorrelation_[RiskType::Commodity] = {
1261 {{"1", "", ""}, 0.16},
1262 {{"2", "", ""}, 0.98},
1263 {{"3", "", ""}, 0.77},
1264 {{"4", "", ""}, 0.82},
1265 {{"5", "", ""}, 0.98},
1266 {{"6", "", ""}, 0.89},
1267 {{"7", "", ""}, 0.96},
1268 {{"8", "", ""}, 0.48},
1269 {{"9", "", ""}, 0.64},
1270 {{"10", "", ""}, 0.39},
1271 {{"11", "", ""}, 0.45},
1272 {{"12", "", ""}, 0.53},
1273 {{"13", "", ""}, 0.65},
1274 {{"14", "", ""}, 0.12},
1275 {{"15", "", ""}, 0.21},
1276 {{"16", "", ""}, 0.00},
1277 {{"17", "", ""}, 0.35}};
1278
1279 // Initialise the single, ad-hoc type, correlations
1280 xccyCorr_ = 0.04;
1281 infCorr_ = 0.42;
1282 infVolCorr_ = 0.42;
1283 irSubCurveCorr_ = 0.986;
1284 irInterCurrencyCorr_ = 0.20;
1286 crqSameIntraCorr_ = 0.94;
1287 crqDiffIntraCorr_ = 0.42;
1289 crnqSameIntraCorr_ = 0.77;
1290 crnqDiffIntraCorr_ = 0.47;
1291 crnqInterCorr_ = 0.69;
1292 fxCorr_ = 0.5;
1293 basecorrCorr_ = 0.18;
1294
1295 // clang-format on
1296}
1297
1298/* The CurvatureMargin must be multiplied by a scale factor of HVR(IR)^{-2}, where HVR(IR)
1299is the historical volatility ratio for the interest-rate risk class (see page 8 section 11(d)
1300of the ISDA-SIMM-v2.3 documentation).
1301*/
1302QuantLib::Real SimmConfiguration_ISDA_V2_3::curvatureMarginScaling() const { return pow(hvr_ir_, -2.0); }
1303
1304void SimmConfiguration_ISDA_V2_3::addLabels2(const RiskType& rt, const string& label_2) {
1305 // Call the shared implementation
1307}
1308
1309string SimmConfiguration_ISDA_V2_3::label2(const QuantLib::ext::shared_ptr<InterestRateIndex>& irIndex) const {
1310 // Special for BMA
1311 if (boost::algorithm::starts_with(irIndex->name(), "BMA")) {
1312 return "Municipal";
1313 }
1314
1315 // Otherwise pass off to base class
1316 return SimmConfigurationBase::label2(irIndex);
1317}
1318
1319} // namespace analytics
1320} // 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
SimmConfiguration_ISDA_V2_3(const QuantLib::ext::shared_ptr< SimmBucketMapper > &simmBucketMapper, const QuantLib::Size &mporDays=10, const std::string &name="SIMM ISDA 2.3 (8 July 2020)", const std::string version="2.3")
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::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.3.
SIMM configuration for SIMM version 2.3.
string name