Beispiel #1
0
        //-------------------------------------------------------------------------
        public virtual void test_createParameterSensitivity()
        {
            InterpolatedNodalCurve test = InterpolatedNodalCurve.of(METADATA_ENTRIES, XVALUES, YVALUES, INTERPOLATOR);

            assertThat(test.createParameterSensitivity(DoubleArray.of(2d, 3d, 4d))).isEqualTo(UnitParameterSensitivity.of(CURVE_NAME, DoubleArray.of(2d, 3d, 4d)));
            assertThat(test.createParameterSensitivity(Currency.GBP, DoubleArray.of(2d, 3d, 4d))).isEqualTo(CurrencyParameterSensitivity.of(CURVE_NAME, Currency.GBP, DoubleArray.of(2d, 3d, 4d)));
        }
Beispiel #2
0
        public virtual void test_createParameterSensitivity()
        {
            DoubleArray values                  = DoubleArray.of(3d, 4d, 6d, 1d, 2d, 5d, 8d);
            DoubleArray valuesBase              = DoubleArray.of(3d, 4d, 6d);
            DoubleArray valuesSpread            = DoubleArray.of(1d, 2d, 5d, 8d);
            UnitParameterSensitivity computed   = COMBINED_CURVE.createParameterSensitivity(values);
            UnitParameterSensitivity baseSens   = BASE_CURVE.createParameterSensitivity(valuesBase);
            UnitParameterSensitivity spreadSens = SPREAD_CURVE.createParameterSensitivity(valuesSpread);

            assertEquals(computed.split(), ImmutableList.of(baseSens, spreadSens));
        }