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

Examples of com.opengamma.analytics.financial.provider.sensitivity.multicurve.SimpleParameterSensitivity


   * Tests parSpread curve sensitivity.
   */
  public void parSpreadCurveSensitivity() {
    final ZonedDateTime referenceDate = TRADE_DATE;
    final DepositCounterpart deposit = DEPOSIT_CPTY_DEFINITION.toDerivative(referenceDate);
    final SimpleParameterSensitivity pspsDepositExact = PS_PSMQ_C.calculateSensitivity(deposit, PROVIDER_ISSUER, PROVIDER_ISSUER.getAllNames());
    final SimpleParameterSensitivity pspsDepositFD = PS_PSMQ_FDC.calculateSensitivity(deposit, PROVIDER_ISSUER);
    AssertSensivityObjects.assertEquals("DepositCounterpartDiscountingMethod: presentValueCurveSensitivity ", pspsDepositExact, pspsDepositFD, TOLERANCE_PV_DELTA);
  }
View Full Code Here


        for (int j = 0; j < perCurveFields.size(); j++) {
          values[j] = (Double) perCurveFields.get(j).getValue();
        }
        sensitivities.put(curve, new DoubleMatrix1D(values));
      }
      return new SimpleParameterSensitivity(sensitivities);
    }
View Full Code Here

    assertEquals("Par Rate swap", ratePayer2, rateReceiver, TOLERANCE_RATE);
  }

  @Test
  public void parRateCurveSensitivity() {
    final SimpleParameterSensitivity psComputed = PS_PR_C.calculateSensitivity(SWAP_PAYER, MULTICURVES, MULTICURVES.getAllNames());
    final SimpleParameterSensitivity psFD = PS_PR_FDC.calculateSensitivity(SWAP_PAYER, MULTICURVES);
    AssertSensivityObjects.assertEquals("CashDiscountingProviderMethod: presentValueCurveSensitivity ", psFD, psComputed, TOLERANCE_RATE_DELTA);
  }
View Full Code Here

    assertEquals("SwapFixedCouponMethod: present value basis point", pvbpExpected, pvbpComputed, TOLERANCE_PV); // one cent out of 100m
  }

  @Test
  public void presentValueBasisPointCurveSensitivity() {
    final SimpleParameterSensitivity psComputed = PS_PVBP_C.calculateSensitivity(SWAP_PAYER, MULTICURVES, MULTICURVES.getAllNames());
    final SimpleParameterSensitivity psFD = PS_PVBP_FDC.calculateSensitivity(SWAP_PAYER, MULTICURVES);
    AssertSensivityObjects.assertEquals("CashDiscountingProviderMethod: presentValueCurveSensitivity ", psFD, psComputed, TOLERANCE_PV_DELTA);
  }
View Full Code Here

    final DoubleMatrix1D sensitivities1 = new DoubleMatrix1D(new double[] {1, 2, 4, 6, 7, 9, 12});
    final DoubleMatrix1D sensitivities2 = new DoubleMatrix1D(new double[] {89, 456, 234, 12});
    final LinkedHashMap<String, DoubleMatrix1D> sensitivities = new LinkedHashMap<>();
    sensitivities.put(name1, sensitivities1);
    sensitivities.put(name2, sensitivities2);
    final SimpleParameterSensitivity sps = new SimpleParameterSensitivity(sensitivities);
    assertEquals(sps, cycleObject(SimpleParameterSensitivity.class, sps));
  }
View Full Code Here

  @Test
  /**
   * Tests the par spread curve sensitivity versus a finite difference computation.
   */
  public void parSpreadCurveSensitivity() {
    final SimpleParameterSensitivity psComputed = PSPSC.calculateSensitivity(FX, MULTICURVES, MULTICURVES.getAllNames());
    final SimpleParameterSensitivity psFD = PSMQCS_FDC.calculateSensitivity(FX, MULTICURVES);
    AssertSensivityObjects.assertEquals("CashDiscountingProviderMethod: presentValueCurveSensitivity ", psFD, psComputed, TOLERANCE_RATE_DELTA);
  }
View Full Code Here

  @Test
  /**
   * Tests the par spread curve sensitivity versus a finite difference computation.
   */
  public void parSpreadCurveSensitivity() {
    final SimpleParameterSensitivity psComputed = PSPSC.calculateSensitivity(FRA, PROVIDER, PROVIDER.getAllNames());
    final SimpleParameterSensitivity psFD = PSMQCS_FDC.calculateSensitivity(FRA, PROVIDER);
    AssertSensivityObjects.assertEquals("CashDiscountingProviderMethod: presentValueCurveSensitivity ", psFD, psComputed, TOLERANCE_SPREAD_DELTA);
  }
View Full Code Here

    AssertSensivityObjects.assertEquals("Bond future security Discounting Method: price from curves", pcsCalculator, pcsMethod, TOLERANCE_PRICE_DELTA);
  }

  @Test
  public void priceCurveSensitivityMethodVsCalculator() {
    final SimpleParameterSensitivity pcsAD = SPS_HW_C.calculateSensitivity(BOND_FUTURE_SEC, MULTICURVES_HW_ISSUER, MULTICURVES_HW_ISSUER.getIssuerProvider().getAllNames());
    final SimpleParameterSensitivity pcsFD = SPS_HW_FDC.calculateSensitivity(BOND_FUTURE_SEC, MULTICURVES_HW_ISSUER);
    AssertSensivityObjects.assertEquals("Bond future security Discounting Method: price from curves", pcsAD, pcsFD, TOLERANCE_PRICE_DELTA);
  }
View Full Code Here

   * Tests parSpread curve sensitivity.
   */
  public void parSpreadCurveSensitivity() {
    final ZonedDateTime referenceDate = TRADE_DATE;
    final DepositIbor deposit = DEPOSIT_IBOR_DEFINITION.toDerivative(referenceDate);
    final SimpleParameterSensitivity pspsDepositExact = PS_PSMQ_C.calculateSensitivity(deposit, PROVIDER_MULTICURVES, PROVIDER_MULTICURVES.getAllNames());
    final SimpleParameterSensitivity pspsDepositFD = PS_PSMQ_FDC.calculateSensitivity(deposit, PROVIDER_MULTICURVES);
    AssertSensivityObjects.assertEquals("DepositCounterpartDiscountingMethod: presentValueCurveSensitivity ", pspsDepositExact, pspsDepositFD, TOLERANCE_PV_DELTA);
  }
View Full Code Here

  private static final double TOLERANCE = 1.0E-5;

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNullMap1() {
    new SimpleParameterSensitivity(null);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.provider.sensitivity.multicurve.SimpleParameterSensitivity

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.