BondCapitalIndexedSecurityDiscountingMethod { public MultipleCurrencyInflationSensitivity presentValueCurveSensitivity(final BondCapitalIndexedSecurity<?> bond, final ParameterInflationIssuerProviderInterface provider) { ArgumentChecker.notNull(bond, "Bond"); MulticurveProviderInterface multicurveDecorated = new MulticurveProviderDiscountingDecoratedIssuer( provider.getIssuerProvider(), bond.getCurrency(), bond.getIssuerEntity()); InflationProviderInterface creditDiscounting = new InflationProviderDecoratedMulticurve( provider.getInflationProvider(), multicurveDecorated); final MultipleCurrencyInflationSensitivity sensitivityNominal = bond.getNominal().accept(PVCSIC, creditDiscounting); final MultipleCurrencyInflationSensitivity sensitivityCoupon = bond.getCoupon().accept(PVCSIC, creditDiscounting); return sensitivityNominal.plus(sensitivityCoupon); }  static BondCapitalIndexedSecurityDiscountingMethod getInstance(); MultipleCurrencyAmount presentValue(final BondCapitalIndexedSecurity<?> bond, 
      final ParameterInflationIssuerProviderInterface provider); MultipleCurrencyAmount presentValueFromCleanRealPrice(final BondCapitalIndexedSecurity<?> bond, 
      final InflationIssuerProviderInterface market, final double cleanPriceReal); MultipleCurrencyAmount presentValueFromCleanNominalPrice(final BondCapitalIndexedSecurity<?> bond, 
      final InflationIssuerProviderInterface market, final double cleanPriceNominal); double accruedInterestFromCleanRealPrice(final BondCapitalIndexedSecurity<?> bond, final double cleanPrice); double accruedInterestFromCleanYield(final BondCapitalIndexedSecurity<?> bond, final double yield); double cleanRealPriceFromDirtyRealPrice(final BondCapitalIndexedSecurity<?> bond, final double dirtyPrice); double cleanNominalPriceFromDirtyNominalPrice(final BondCapitalIndexedSecurity<?> bond, final double dirtyPrice); double cleanRealPriceFromCurves(final BondCapitalIndexedSecurity<?> bond, 
      final InflationIssuerProviderInterface curves); double cleanNominalPriceFromCurves(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves); double cleanRealPriceFromCleanNominalPrice(final BondCapitalIndexedSecurity<?> bond, final double cleanNominalPrice, final InflationIssuerProviderInterface issuerMulticurves); double dirtyNominalPriceFromCurves(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves); double dirtyRealPriceFromCurves(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves); double dirtyRealPriceFromCleanRealPrice(final BondCapitalIndexedSecurity<?> bond, final double cleanPrice); MultipleCurrencyAmount netAmount(final BondCapitalIndexedSecurity<Coupon> bond, final InflationIssuerProviderInterface market, final double cleanPriceReal); double dirtyPriceFromRealYield(final BondCapitalIndexedSecurity<?> bond, final double yield); double cleanPriceFromYield(final BondCapitalIndexedSecurity<?> bond, final double yield); double yieldRealFromDirtyRealPrice(final BondCapitalIndexedSecurity<?> bond, final double dirtyPrice); MultipleCurrencyInflationSensitivity presentValueCurveSensitivity(final BondCapitalIndexedSecurity<?> bond, 
      final ParameterInflationIssuerProviderInterface provider); double yieldRealFromCleanPrice(final BondCapitalIndexedSecurity<?> bond, final double cleanPrice); double modifiedDurationFromYieldStandard(final BondCapitalIndexedSecurity<?> bond, final double yield); double modifiedDurationFromYieldFiniteDifference(final BondCapitalIndexedSecurity<?> bond, final double yield); double convexityFromYieldFiniteDifference(final BondCapitalIndexedSecurity<?> bond, final double yield); double yieldRealFromCurves(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface provider); double modifiedDurationFromCurves(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves); double yieldRealFromCleanRealPrice(final BondCapitalIndexedSecurity<?> bond, final double cleanPrice); double modifiedDurationFromCleanPrice(final BondCapitalIndexedSecurity<?> bond, final double cleanPrice); double convexityFromYieldStandard(final BondCapitalIndexedSecurity<?> bond, final double yield); double convexityFromCurves(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves); double convexityFromCleanPrice(final BondCapitalIndexedSecurity<?> bond, final double cleanPrice); MultipleCurrencyAmount presentValueFromZSpread(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves, final double zSpread); double cleanPriceFromZSpread(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves, final double zSpread); double zSpreadFromCurvesAndCleanPriceDirect(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves, final double cleanPrice); double zSpreadFromCurvesAndCleanRealPriceDirect(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves, final double cleanRealPrice); double zSpreadFromCurvesAndCleanNominalPriceDirect(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves, final double cleanRealPrice); double zSpreadFromCurvesAndPV(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves, final MultipleCurrencyAmount pv); double zSpreadFromCurvesAndCleanPrice(final BondCapitalIndexedSecurity<Coupon> bond, final InflationIssuerProviderInterface issuerMulticurves, final double cleanPrice);  }
@Test public void presentValueCurveSensitivityCAIN() { MulticurveProviderInterface multicurveDecorated = new MulticurveProviderDiscountingDecoratedIssuer( MARKET.getIssuerProvider(), BOND_SECURITY_CAIN.getCurrency(), BOND_SECURITY_CAIN.getIssuerEntity()); InflationProviderInterface creditDiscounting = new InflationProviderDecoratedMulticurve( MARKET.getInflationProvider(), multicurveDecorated); final MultipleCurrencyInflationSensitivity sensitivityNominal = BOND_SECURITY_CAIN.getNominal().accept(PVCSDC, creditDiscounting); final MultipleCurrencyInflationSensitivity sensitivityCoupon = BOND_SECURITY_CAIN.getCoupon().accept(PVCSDC, creditDiscounting); final MultipleCurrencyInflationSensitivity pvcisCalculated = sensitivityNominal.plus(sensitivityCoupon); final MultipleCurrencyInflationSensitivity pvcisMethod = METHOD_BOND_INFLATION.presentValueCurveSensitivity(BOND_SECURITY_CAIN, MARKET); AssertSensitivityObjects.assertEquals("Bond capital indexed security: presentValueCurveSensitivity ", pvcisCalculated, pvcisMethod, TOLERANCE_PV_DELTA); }
@Test public void presentValueCurveSensitivity() { MulticurveProviderInterface multicurveDecorated = new MulticurveProviderDiscountingDecoratedIssuer( MARKET.getIssuerProvider(), BOND_SECURITY_GILT_1.getCurrency(), BOND_SECURITY_GILT_1.getIssuerEntity()); InflationProviderInterface inflationDecorated = new InflationProviderDecoratedMulticurve( MARKET.getInflationProvider(), multicurveDecorated); final MultipleCurrencyInflationSensitivity sensitivityNominal = BOND_SECURITY_GILT_1.getNominal().accept(PVCSDC, inflationDecorated); final MultipleCurrencyInflationSensitivity sensitivityCoupon = BOND_SECURITY_GILT_1.getCoupon().accept(PVCSDC, inflationDecorated); final MultipleCurrencyInflationSensitivity pvcisCalculated = sensitivityNominal.plus(sensitivityCoupon); final MultipleCurrencyInflationSensitivity pvcisMethod = METHOD_BOND_INFLATION.presentValueCurveSensitivity(BOND_SECURITY_GILT_1, MARKET); AssertSensitivityObjects.assertEquals("Bond capital indexed security: presentValueCurveSensitivity ", pvcisCalculated, pvcisMethod, TOLERANCE_PV_DELTA); }