Exemple #1
0
        public virtual void test_curveParameterSensitivity()
        {
            ImmutableLegalEntityDiscountingProvider test = ImmutableLegalEntityDiscountingProvider.builder().issuerCurves(ImmutableMap.of(Pair.of(GROUP_ISSUER, GBP), DSC_FACTORS_ISSUER)).issuerCurveGroups(ImmutableMap.of(ID_ISSUER, GROUP_ISSUER)).repoCurves(ImmutableMap.of(Pair.of(GROUP_REPO_ISSUER, GBP), DSC_FACTORS_REPO)).repoCurveGroups(ImmutableMap.of(ID_ISSUER, GROUP_REPO_ISSUER)).valuationDate(DATE).build();
            LocalDate refDate = date(2018, 11, 24);
            IssuerCurveZeroRateSensitivity sensi1   = test.issuerCurveDiscountFactors(ID_ISSUER, GBP).zeroRatePointSensitivity(refDate, GBP);
            RepoCurveZeroRateSensitivity   sensi2   = test.repoCurveDiscountFactors(ID_SECURITY, ID_ISSUER, GBP).zeroRatePointSensitivity(refDate, GBP);
            PointSensitivities             sensi    = PointSensitivities.of(sensi1, sensi2);
            CurrencyParameterSensitivities computed = test.parameterSensitivity(sensi);
            CurrencyParameterSensitivities expected = DSC_FACTORS_ISSUER.parameterSensitivity(sensi1.createZeroRateSensitivity()).combinedWith(DSC_FACTORS_REPO.parameterSensitivity(sensi2.createZeroRateSensitivity()));

            assertTrue(computed.equalWithTolerance(expected, 1.0e-12));
        }