Esempio n. 1
0
        public virtual void test_presentValueSensitivityVolatility()
        {
            PointSensitivityBuilder computed1 = PRICER.presentValueSensitivityModelParamsVolatility(CAP_ONE_LEG, RATES, VOLS);
            PointSensitivityBuilder computed2 = PRICER.presentValueSensitivityModelParamsVolatility(CAP_TWO_LEGS, RATES, VOLS);
            PointSensitivityBuilder cap       = PRICER_CAP_LEG.presentValueSensitivityModelParamsVolatility(CAP_LEG, RATES, VOLS);

            assertEquals(computed1, cap);
            assertEquals(computed2, cap);
        }
Esempio n. 2
0
        public virtual void test_presentValueSensitivityModelParamsVolatility()
        {
            PointSensitivities computedWithPayLeg  = PRICER.presentValueSensitivityModelParamsVolatility(TRADE_PAYLEG, RATES, VOLS).build();
            PointSensitivities computedWithPremium = PRICER.presentValueSensitivityModelParamsVolatility(TRADE_PREMIUM, RATES, VOLS).build();
            PointSensitivities pvOneLeg            = PRICER_PRODUCT.presentValueSensitivityModelParamsVolatility(CAP_ONE_LEG, RATES, VOLS).build();
            PointSensitivities pvTwoLegs           = PRICER_PRODUCT.presentValueSensitivityModelParamsVolatility(CAP_TWO_LEGS, RATES, VOLS).build();

            assertEquals(computedWithPayLeg, pvTwoLegs);
            assertEquals(computedWithPremium, pvOneLeg);
        }