CouponInflationZeroCouponInterpolationGearingDiscountingMethod { public MultipleCurrencyInflationSensitivity presentValueCurveSensitivity(final CouponInflationZeroCouponInterpolationGearing coupon, final InflationProviderInterface inflation) { ArgumentChecker.notNull(coupon, "Coupon"); ArgumentChecker.notNull(inflation, "Inflation"); final double estimatedIndexMonth0 = inflation.getPriceIndex(coupon.getPriceIndex(), coupon.getReferenceEndTime()[0]); final double estimatedIndexMonth1 = inflation.getPriceIndex(coupon.getPriceIndex(), coupon.getReferenceEndTime()[1]); final double estimatedIndex = coupon.getWeight() * estimatedIndexMonth0 + (1 - coupon.getWeight()) * estimatedIndexMonth1; final double discountFactor = inflation.getDiscountFactor(coupon.getCurrency(), coupon.getPaymentTime()); final double pvBar = 1.0; final double discountFactorBar = coupon.getFactor() * (estimatedIndex / coupon.getIndexStartValue() - (coupon.payNotional() ? 0.0 : 1.0)) * coupon.getNotional() * pvBar; final double estimatedIndexBar = coupon.getFactor() / coupon.getIndexStartValue() * discountFactor * coupon.getNotional() * pvBar; final double estimatedIndexMonth1Bar = (1 - coupon.getWeight()) * estimatedIndexBar; final double estimatedIndexMonth0Bar = coupon.getWeight() * estimatedIndexBar; final Map<String, List<DoublesPair>> resultMapDisc = new HashMap<>(); final List<DoublesPair> listDiscounting = new ArrayList<>(); listDiscounting.add(DoublesPair.of(coupon.getPaymentTime(), -coupon.getPaymentTime() * discountFactor * discountFactorBar)); resultMapDisc.put(inflation.getName(coupon.getCurrency()), listDiscounting); final Map<String, List<DoublesPair>> resultMapPrice = new HashMap<>(); final List<DoublesPair> listPrice = new ArrayList<>(); listPrice.add(DoublesPair.of(coupon.getReferenceEndTime()[0], estimatedIndexMonth0Bar)); listPrice.add(DoublesPair.of(coupon.getReferenceEndTime()[1], estimatedIndexMonth1Bar)); resultMapPrice.put(inflation.getName(coupon.getPriceIndex()), listPrice); final InflationSensitivity inflationSensitivity = InflationSensitivity.ofYieldDiscountingAndPriceIndex(resultMapDisc, resultMapPrice); return MultipleCurrencyInflationSensitivity.of(coupon.getCurrency(), inflationSensitivity); }  MultipleCurrencyAmount presentValue(final CouponInflationZeroCouponInterpolationGearing coupon, final InflationProviderInterface inflation); MultipleCurrencyAmount netAmount(final CouponInflationZeroCouponInterpolationGearing coupon, final InflationProviderInterface inflation); double indexEstimation(final CouponInflationZeroCouponInterpolationGearing coupon, final InflationProviderInterface inflation); MultipleCurrencyInflationSensitivity presentValueCurveSensitivity(final CouponInflationZeroCouponInterpolationGearing coupon, final InflationProviderInterface inflation);  }
@Test public void presentValueMarketSensitivityMethodVsCalculatorNoNotional() { final MultipleCurrencyInflationSensitivity pvcisMethod = METHOD.presentValueCurveSensitivity(ZERO_COUPON_1, MARKET.getInflationProvider()); final MultipleCurrencyInflationSensitivity pvcisCalculator = ZERO_COUPON_1.accept(PVCSDC, MARKET.getInflationProvider()); AssertSensitivityObjects.assertEquals("Zero-coupon inflation DiscountingMethod: presentValueMarketSensitivity", pvcisMethod, pvcisCalculator, TOLERANCE_PV_DELTA); }