Package com.opengamma.analytics.financial.provider.sensitivity.inflation

Examples of com.opengamma.analytics.financial.provider.sensitivity.inflation.MultipleCurrencyInflationSensitivity


    final MulticurveSensitivity sensitivities2 = MulticurveSensitivity.of(yieldCurveSensitivities2, forwardCurveSensitivities2);
    final Map<String, List<DoublesPair>> priceCurveSensitivities2 = new HashMap<>();
    priceCurveSensitivities1.put("PC3", Arrays.asList(new DoublesPair(1.21, 2.31), new DoublesPair(3.41, 4.51)));
    priceCurveSensitivities1.put("PC4", Arrays.asList(new DoublesPair(9.81, 8.71), new DoublesPair(5.41, 3.21), new DoublesPair(2.331, 3.441)));
    final InflationSensitivity is2 = InflationSensitivity.of(sensitivities2, priceCurveSensitivities2);
    MultipleCurrencyInflationSensitivity sensitivities = new MultipleCurrencyInflationSensitivity();
    sensitivities = sensitivities.plus(Currency.AUD, is1);
    sensitivities = sensitivities.plus(Currency.CAD, is2);
    assertEquals(sensitivities, cycleObject(MultipleCurrencyInflationSensitivity.class, sensitivities));
  }
View Full Code Here


  @Test
  public void of() {
    final InflationSensitivity cs = InflationSensitivity.of(SENSI_11, SENSI_FWD_11, SENSI_33);
    final Currency ccy1 = Currency.AUD;
    final MultipleCurrencyInflationSensitivity mcs = MultipleCurrencyInflationSensitivity.of(ccy1, cs);
    assertEquals("MultipleCurrencyCurveSensitivityMarket: of", cs, mcs.getSensitivity(ccy1));
    MultipleCurrencyInflationSensitivity constructor = new MultipleCurrencyInflationSensitivity();
    constructor = constructor.plus(ccy1, cs);
    AssertSensivityObjects.assertEquals("MultipleCurrencyCurveSensitivityMarket: of", mcs.cleaned(), constructor.cleaned(), TOLERANCE);
    AssertSensivityObjects.assertEquals("MultipleCurrencyCurveSensitivityMarket: getSensitivity", new InflationSensitivity(), mcs.getSensitivity(Currency.CAD), TOLERANCE);
  }
View Full Code Here

  @Test
  public void plusMultipliedBy() {
    final Currency ccy1 = Currency.AUD;
    final Currency ccy2 = Currency.CAD;
    final InflationSensitivity cs = InflationSensitivity.of(SENSI_11, SENSI_FWD_11, SENSI_33);
    MultipleCurrencyInflationSensitivity mcs = MultipleCurrencyInflationSensitivity.of(ccy1, cs);
    final InflationSensitivity cs2 = InflationSensitivity.ofYieldDiscounting(SENSI_22);
    final MultipleCurrencyInflationSensitivity mcs2 = MultipleCurrencyInflationSensitivity.of(ccy1, cs2);
    final MultipleCurrencyInflationSensitivity mcs3 = mcs.plus(mcs2);
    final Map<String, List<DoublesPair>> sum = InterestRateCurveSensitivityUtils.addSensitivity(SENSI_11, SENSI_22);
    final MultipleCurrencyInflationSensitivity mcs3Expected = MultipleCurrencyInflationSensitivity.of(ccy1, InflationSensitivity.of(sum, SENSI_FWD_11, SENSI_33));
    AssertSensivityObjects.assertEquals("", mcs3Expected.cleaned(), mcs3.cleaned(), TOLERANCE);
    mcs = mcs.plus(ccy2, cs);
    assertEquals("MultipleCurrencyCurveSensitivityMarket: plusMultipliedBy", cs, mcs.getSensitivity(ccy1));
    assertEquals("MultipleCurrencyCurveSensitivityMarket: plusMultipliedBy", cs, mcs.getSensitivity(ccy2));
    AssertSensivityObjects.assertEquals("", mcs.plus(mcs).cleaned(), mcs.multipliedBy(2.0).cleaned(), TOLERANCE);
  }
View Full Code Here

  public void cleaned() {
    final Currency ccy1 = Currency.AUD;
    final Currency ccy2 = Currency.CAD;
    final InflationSensitivity cs1 = InflationSensitivity.of(SENSI_11, SENSI_FWD_11, SENSI_33);
    final InflationSensitivity cs2 = InflationSensitivity.of(SENSI_22, SENSI_FWD_11, SENSI_33);
    MultipleCurrencyInflationSensitivity mcs1 = MultipleCurrencyInflationSensitivity.of(ccy1, cs1);
    mcs1 = mcs1.plus(ccy2, cs2);
    MultipleCurrencyInflationSensitivity mcs2 = MultipleCurrencyInflationSensitivity.of(ccy2, cs2);
    mcs2 = mcs2.plus(ccy1, cs1);
    AssertSensivityObjects.assertEquals("MultipleCurrencyCurveSensitivityMarket: cleaned", mcs1.cleaned(), mcs2.cleaned(), TOLERANCE);
  }
View Full Code Here

  public void converted() {
    final Currency ccy1 = Currency.EUR;
    final Currency ccy2 = Currency.USD;
    final FXMatrix fxMatrix = new FXMatrix(ccy1, ccy2, 1.25);
    final InflationSensitivity cs = InflationSensitivity.of(SENSI_11, SENSI_FWD_11, SENSI_33);
    final MultipleCurrencyInflationSensitivity mcs = MultipleCurrencyInflationSensitivity.of(ccy1, cs);
    final MultipleCurrencyInflationSensitivity mcsConverted = mcs.converted(ccy2, fxMatrix);
    final MultipleCurrencyInflationSensitivity mcsExpected = MultipleCurrencyInflationSensitivity.of(ccy2, cs.multipliedBy(fxMatrix.getFxRate(ccy1, ccy2)));
    AssertSensivityObjects.assertEquals("MultipleCurrencyCurveSensitivityMarket: converted", mcsExpected.cleaned(), mcsConverted.cleaned(), TOLERANCE);
  }
View Full Code Here

  @Test
  public void equalHash() {
    final Currency ccy1 = Currency.EUR;
    final Currency ccy2 = Currency.USD;
    final InflationSensitivity cs = InflationSensitivity.of(SENSI_11, SENSI_FWD_11, SENSI_33);
    final MultipleCurrencyInflationSensitivity mcs = MultipleCurrencyInflationSensitivity.of(ccy1, cs);
    assertEquals("MultipleCurrencyCurveSensitivityMarket: equalHash", mcs, mcs);
    assertEquals("MultipleCurrencyCurveSensitivityMarket: equalHash", mcs.hashCode(), mcs.hashCode());
    assertFalse("MultipleCurrencyCurveSensitivityMarket: equalHash", mcs.equals(null));
    assertFalse("MultipleCurrencyCurveSensitivityMarket: equalHash", mcs.equals(SENSI_11));
    final MultipleCurrencyInflationSensitivity other = MultipleCurrencyInflationSensitivity.of(ccy1, cs);
    assertEquals("MultipleCurrencyCurveSensitivityMarket: equalHash", mcs, other);
    MultipleCurrencyInflationSensitivity modified;
    modified = MultipleCurrencyInflationSensitivity.of(ccy2, cs);
    assertFalse("MultipleCurrencyCurveSensitivityMarket: equalHash", mcs.equals(modified));
  }
View Full Code Here

    AssertSensivityObjects.assertEquals("Year on year coupon inflation DiscountingMethod: presentValueCurveSensitivity ", pvicsExact, pvicsFD, TOLERANCE_PV_DELTA);
  }

  @Test
  public void presentValueMarketSensitivityMethodVsCalculatorNoNotional() {
    final MultipleCurrencyInflationSensitivity pvcisMethod = METHOD.presentValueCurveSensitivity(YEAR_ON_YEAR_NO, MARKET.getInflationProvider());
    final MultipleCurrencyInflationSensitivity pvcisCalculator = YEAR_ON_YEAR_NO.accept(PVCSDC, MARKET.getInflationProvider());
    AssertSensivityObjects.assertEquals("Year on year coupon inflation DiscountingMethod: presentValueMarketSensitivity", pvcisMethod, pvcisCalculator, TOLERANCE_PV_DELTA);
  }
View Full Code Here

    AssertSensivityObjects.assertEquals("Year on year coupon inflation DiscountingMethod: presentValueMarketSensitivity", pvcisMethod, pvcisCalculator, TOLERANCE_PV_DELTA);
  }

  @Test
  public void presentValueMarketSensitivityMethodVsCalculatorWithNotional() {
    final MultipleCurrencyInflationSensitivity pvcisMethod = METHOD.presentValueCurveSensitivity(YEAR_ON_YEAR_WITH, MARKET.getInflationProvider());
    final MultipleCurrencyInflationSensitivity pvcisCalculator = YEAR_ON_YEAR_WITH.accept(PVCSDC, MARKET.getInflationProvider());
    AssertSensivityObjects.assertEquals("Year on year coupon inflation DiscountingMethod: presentValueMarketSensitivity", pvcisMethod, pvcisCalculator, TOLERANCE_PV_DELTA);
  }
View Full Code Here

  }

  @Test
  public void presentValueMarketSensitivityMethodVsCalculatorNoNotional() {
    final MultipleCurrencyInflationSensitivity pvcisMethod = METHOD.presentValueCurveSensitivity(YEAR_ON_YEAR_NO, MARKET.getInflationProvider());
    final MultipleCurrencyInflationSensitivity pvcisCalculator = YEAR_ON_YEAR_NO.accept(PVCSDC, MARKET.getInflationProvider());
    AssertSensivityObjects.assertEquals("Year on year coupon inflation DiscountingMethod: presentValueMarketSensitivity", pvcisMethod, pvcisCalculator, TOLERANCE_PV_DELTA);
  }
View Full Code Here

    AssertSensivityObjects.assertEquals("Year on year coupon inflation DiscountingMethod: presentValueMarketSensitivity", pvcisMethod, pvcisCalculator, TOLERANCE_PV_DELTA);
  }

  @Test
  public void presentValueMarketSensitivityMethodVsCalculatorWithNotional() {
    final MultipleCurrencyInflationSensitivity pvcisMethod = METHOD.presentValueCurveSensitivity(YEAR_ON_YEAR_WITH, MARKET.getInflationProvider());
    final MultipleCurrencyInflationSensitivity pvcisCalculator = YEAR_ON_YEAR_WITH.accept(PVCSDC, MARKET.getInflationProvider());
    AssertSensivityObjects.assertEquals("Year on year coupon inflation DiscountingMethod: presentValueMarketSensitivity", pvcisMethod, pvcisCalculator, TOLERANCE_PV_DELTA);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.provider.sensitivity.inflation.MultipleCurrencyInflationSensitivity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.