Skip to content

Commit 9486248

Browse files
pcaspersjenkins
authored andcommitted
QPR-12201 update cached results in unit tests or update tolerance
1 parent 43c57cc commit 9486248

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

OREAnalytics/test/nettedexpsoure.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -431,18 +431,18 @@ CachedResultsData(){
431431
tuple<string, string, string, string, string, string> key;
432432
key = make_tuple("13,1W", "1W", "woCloseOutGrid", "ActualDate", "Symmetric", "woCompounding");
433433
vector<Date> defaultDate = {Date(42481),Date(42488),Date(42495),Date(42502),Date(42509),Date(42516),Date(42523),Date(42530),Date(42537),Date(42544),Date(42551),Date(42558),Date(42565)};
434-
vector<Real> defaultValue = {-5186.33839194918,-4905.49750714248,-4548.69910041274,-4934.74752203131,-4721.35208103624,-4728.18840345129,-4942.29809042893,-4829.79935176886,-4872.32605339788,-4661.93964349494,-4836.57610017441,-5209.59281418126,-5111.60742248725};
434+
vector<Real> defaultValue = {-5187.5422,-4905.1896,-4546.209,-4934.3538,-4719.8216,-4726.7086,-4942.2042,-4829.1002,-4871.8577,-4660.3374,-4835.9162,-5210.7846,-5112.2817};
435435
vector<Date> closeOutDate = {};
436-
vector<Real> closeOutValue = {-4964.24586512324,-5186.33839194918,-4905.49750714248,-4548.69910041274,-4934.74752203131,-4721.35208103624,-4728.18840345129,-4942.29809042893,-4829.79935176886,-4872.32605339788,-4661.93964349494,-4836.57610017441,-5209.59281418126};
436+
vector<Real> closeOutValue = {-4964.2459,-5187.5422,-4905.1896,-4546.209,-4934.3538,-4719.8216,-4726.7086,-4942.2042,-4829.1002,-4871.8577,-4660.3374,-4835.9162,-5210.7846};
437437
defaultDates[key] = defaultDate;
438438
defaultValues[key] = defaultValue;
439439
closeOutDates[key] = closeOutDate;
440440
closeOutValues[key] = closeOutValue;
441441

442442
key = make_tuple("13,1W", "1W", "woCloseOutGrid", "ActualDate", "AsymmetricCVA", "woCompounding");
443443
defaultDate = {Date(42481),Date(42488),Date(42495),Date(42502),Date(42509),Date(42516),Date(42523),Date(42530),Date(42537),Date(42544),Date(42551),Date(42558),Date(42565)};
444-
defaultValue = {-5186.33839194918,-4905.49750714248,-4548.69910041274,-4934.74752203131,-4721.35208103624,-4728.18840345129,-4942.29809042893,-4829.79935176886,-4872.32605339788,-4661.93964349494,-4836.57610017441,-5209.59281418126,-5111.60742248725};
445-
closeOutValue = {-5186.33839194918,-5186.33839194918,-4905.49750714248,-4934.74752203131,-4934.74752203131,-4728.18840345129,-4942.29809042893,-4942.29809042893,-4872.32605339788,-4872.32605339788,-4836.57610017441,-5209.59281418126,-5209.59281418126};
444+
defaultValue = {-5187.5422,-4905.1896,-4546.209,-4934.3538,-4719.8216,-4726.7086,-4942.2042,-4829.1002,-4871.8577,-4660.3374,-4835.9162,-5210.7846,-5112.2817};
445+
closeOutValue = {-5187.5422,-5187.5422,-4905.1896,-4934.3538,-4934.3538,-4726.7086,-4942.2042,-4942.2042,-4871.8577,-4871.8577,-4835.9162,-5210.7846,-5210.7846};
446446
defaultDates[key] = defaultDate;
447447
defaultValues[key] = defaultValue;
448448
closeOutDates[key] = closeOutDate;
@@ -451,8 +451,8 @@ CachedResultsData(){
451451

452452
key = make_tuple("13,1W", "1W", "woCloseOutGrid", "ActualDate", "AsymmetricDVA", "woCompounding");
453453
defaultDate = {Date(42481),Date(42488),Date(42495),Date(42502),Date(42509),Date(42516),Date(42523),Date(42530),Date(42537),Date(42544),Date(42551),Date(42558),Date(42565)};
454-
defaultValue = {-5186.33839194918,-4905.49750714248,-4548.69910041274,-4934.74752203131,-4721.35208103624,-4728.18840345129,-4942.29809042893,-4829.79935176886,-4872.32605339788,-4661.93964349494,-4836.57610017441,-5209.59281418126,-5111.60742248725};
455-
closeOutValue = {-4964.24586512324,-4905.49750714248,-4548.69910041274,-4548.69910041274,-4721.35208103624,-4721.35208103624,-4728.18840345129,-4829.79935176886,-4829.79935176886,-4661.93964349494,-4661.93964349494,-4836.57610017441,-5111.60742248725};
454+
defaultValue = {-5187.5422,-4905.1896,-4546.209,-4934.3538,-4719.8216,-4726.7086,-4942.2042,-4829.1002,-4871.8577,-4660.3374,-4835.9162,-5210.7846,-5112.2817};
455+
closeOutValue = {-4964.2459,-4905.1896,-4546.209,-4546.209,-4719.8216,-4719.8216,-4726.7086,-4829.1002,-4829.1002,-4660.3374,-4660.3374,-4835.9162,-5112.2817};
456456
defaultDates[key] = defaultDate;
457457
defaultValues[key] = defaultValue;
458458
closeOutDates[key] = closeOutDate;
@@ -461,8 +461,8 @@ CachedResultsData(){
461461
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
462462
key = make_tuple("13,1M", "1W", "withCloseOutGrid", "ActualDate", "NoLag", "woCompounding");
463463
defaultDate = {Date(42506),Date(42535),Date(42565),Date(42597),Date(42627),Date(42657),Date(42688),Date(42718),Date(42751),Date(42780),Date(42808),Date(42843),Date(42870)};
464-
defaultValue = {-5201.05244612274,-4824.95292840006,-4477.84062127441,-4840.59273964169,-4783.19175595342,-10033.5472051449,-10033.8518374855,-10042.17634737,-10050.6267511171,-10028.9670934353,-10053.5482862015,0,0};
465-
closeOutValue = {-5480.43076439459,-4433.281369965,-4468.94866890169,-4953.02218430623,-4985.17359043462,-10026.4183374549,-10030.1017618035,-10036.1263742983,-10048.9573202704,-10023.9263145357,-10050.3607175246,0,0};
464+
defaultValue = {-5202.1081,-4824.2195,-4475.0983,-4839.8679,-4781.7627,-10033.828,-10034.132,-10042.506,-10051.002,-10029.219,-10053.942,0,0};
465+
closeOutValue = {-5482.992,-4430.4454,-4466.1567,-4952.8999,-4984.8645,-10026.681,-10030.382,-10036.444,-10049.344,-10024.172,-10050.758,0,0};
466466
defaultDates[key] = defaultDate;
467467
defaultValues[key] = defaultValue;
468468
closeOutDates[key] = closeOutDate;
@@ -677,7 +677,7 @@ BOOST_AUTO_TEST_CASE(NettedExposureCalculatorTest) {
677677
BOOST_TEST_MESSAGE("cdv "<<cdv.size());
678678
BOOST_TEST_MESSAGE("ccd "<<ccd.size());
679679
BOOST_TEST_MESSAGE("ccv "<<ccv.size());
680-
Real tolerance = 0.000001;
680+
Real tolerance = 1E-2;
681681
for (auto n : nettingSetValue){
682682
vector<vector<Real>> defaultValue = n.second;
683683
for (Size j = 0; j < cube->dates().size(); j++){

OREAnalytics/test/observationmode.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,12 @@ void simulation(string dateGridString, bool checkFixings) {
329329

330330
map<string, vector<Real>> referenceFixings;
331331
// First 10 EUR-EURIBOR-6M fixings at dateIndex 5, date grid 11,1Y
332-
referenceFixings["11,1Y"] = {0.00745427, 0.028119, 0.0343574, 0.0335416, 0.0324554, 0.0305116,
333-
0.00901458, 0.016573, 0.0194405, 0.0113262, 0.0238971};
332+
referenceFixings["11,1Y"] = {0.00739033, 0.0281673, 0.0344399, 0.03362, 0.0325276, 0.030573,
333+
0.00895957, 0.0165584, 0.0194418, 0.0112834, 0.0239227};
334334

335335
// First 10 EUR-EURIBOR-6M fixings at dateIndex 5, date grid 10,1Y
336-
referenceFixings["10,1Y"] = {0.00745427, 0.0296431, 0.0338739, 0.012485, 0.0135247, 0.0148336,
337-
0.018856, 0.0276796, 0.0349766, 0.0105696, 0.0103713};
336+
referenceFixings["10,1Y"] = {0.00739033, 0.0296998, 0.0339535, 0.012449, 0.0134939, 0.0148095,
337+
0.0188541, 0.0277254, 0.035063, 0.0105228, 0.0103237};
338338

339339
if (simMarket->aggregationScenarioData()) {
340340
QL_REQUIRE(dateGridString == "10,1Y" || dateGridString == "11,1Y",

OREAnalytics/test/simulationmeasures.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ void test_measure(std::string measureName, Real shiftHorizon, std::string discNa
258258

259259
Date d1 = grid->dates().back();
260260
Date d2 = d1 + horizon * Years;
261-
Real relTolerance = 0.005;
261+
Real relTolerance = 0.01;
262262
Real eurExpected = d.market->discountCurve("EUR")->discount(d2);
263263
Real eurExpected2 = d.market->discountCurve("EUR")->discount(d1);
264264
Real gbpExpected = d.market->fxRate("GBPEUR")->value() * d.market->discountCurve("GBP")->discount(d2);

0 commit comments

Comments
 (0)