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

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


  @Test
  public void getAllNamesCurrency() {
    final LinkedHashMap<String, DoubleMatrix1D> map1 = Maps.newLinkedHashMap();
    map1.put(NAME_1, SENSITIVITY_1_1);
    map1.put(NAME_2, SENSITIVITY_1_2);
    final SimpleParameterSensitivity sensitivity1 = new SimpleParameterSensitivity(map1);
    assertEquals("ParameterSensitivity: getAllNamesCurrency", sensitivity1.getAllNames(), sensitivity1.getSensitivities().keySet());
    assertEquals("ParameterSensitivity: getAllNamesCurrency", sensitivity1.getSensitivity(NAME_1), sensitivity1.getSensitivity(NAME_1));
    assertEquals("ParameterSensitivity: getAllNamesCurrency", sensitivity1.getSensitivity(NAME_2), sensitivity1.getSensitivity(NAME_2));
  }
View Full Code Here


    assertEquals("ParameterSensitivity: getAllNamesCurrency", sensitivity1.getSensitivity(NAME_2), sensitivity1.getSensitivity(NAME_2));
  }

  @Test
  public void equalHash() {
    SimpleParameterSensitivity sensitivity = new SimpleParameterSensitivity();
    sensitivity = sensitivity.plus(NAME_1, SENSITIVITY_1_1);
    sensitivity = sensitivity.plus(NAME_2, SENSITIVITY_2_1);
    SimpleParameterSensitivity modified = new SimpleParameterSensitivity();
    modified = modified.plus(NAME_2, SENSITIVITY_2_1);
    modified = modified.plus(NAME_2, SENSITIVITY_2_1);
    assertEquals("ParameterSensitivity: equalHash", sensitivity, sensitivity);
    assertEquals("ParameterSensitivity: equalHash", sensitivity.hashCode(), sensitivity.hashCode());
    assertFalse("ParameterSensitivity: equalHash", sensitivity.equals(SENSITIVITY_1_1));
    assertFalse("ParameterSensitivity: equalHash", sensitivity.equals(modified));
  }
View Full Code Here

  @Test
  /**
   * Test the price curve sensitivity versus a finite difference computation.
   */
  public void priceCurveSensitivity() {
    final SimpleParameterSensitivity pcsExact = SPSHWC.calculateSensitivity(OPT_ERM4_MID_CALL_9875, HW_MULTICURVES, MULTICURVES.getAllNames());
    final SimpleParameterSensitivity pcsFD = SPSHWC_FD.calculateSensitivity(OPT_ERM4_MID_CALL_9875, HW_MULTICURVES);
    AssertSensivityObjects.assertEquals("DeliverableSwapFuturesSecurityHullWhiteMethod: priceCurveSensitivity", pcsExact, pcsFD, TOLERANCE_PRICE_DELTA);
  }
View Full Code Here

  }

  @Test(enabled = false)
  // TODO
  public void priceCurveSensitivity() {
    final SimpleParameterSensitivity pcsExact = PS_MQ_C.calculateSensitivity(SWAP_FUTURES_SECURITY, HW_MULTICURVES, MULTICURVES.getAllNames());
    final SimpleParameterSensitivity pcsFD = PS_MQ_FDC.calculateSensitivity(SWAP_FUTURES_SECURITY, HW_MULTICURVES);
    AssertSensivityObjects.assertEquals("DeliverableSwapFuturesSecurityHullWhiteMethod: priceCurveSensitivity", pcsExact, pcsFD, TOLERANCE_PRICE_DELTA);
  }
View Full Code Here

  @Test
  /**
   * Test the price curve sensitivity versus a finite difference computation.
   */
  public void priceCurveSensitivity() {
    final SimpleParameterSensitivity pcsExact = SPSHWC.calculateSensitivity(ERU2, HW_MULTICURVES, MULTICURVES.getAllNames());
    final SimpleParameterSensitivity pcsFD = SPSHWC_FD.calculateSensitivity(ERU2, HW_MULTICURVES);
    AssertSensivityObjects.assertEquals("DeliverableSwapFuturesSecurityHullWhiteMethod: priceCurveSensitivity", pcsExact, pcsFD, TOLERANCE_PRICE_DELTA);
  }
View Full Code Here

   * Tests parSpread curve sensitivity.
   */
  public void parSpreadCurveSensitivity() {
    final ZonedDateTime referenceDate = TRADE_DATE;
    final Cash deposit = DEPOSIT_DEFINITION.toDerivative(referenceDate);
    final SimpleParameterSensitivity pspsDepositExact = PS_PSMQ_C.calculateSensitivity(deposit, PROVIDER, PROVIDER.getAllNames());
    final SimpleParameterSensitivity pspsDepositFD = PS_PSMQ_FDC.calculateSensitivity(deposit, PROVIDER);
    AssertSensivityObjects.assertEquals("DepositCounterpartDiscountingMethod: presentValueCurveSensitivity ", pspsDepositExact, pspsDepositFD, TOLERANCE_PV_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(FX_SWAP, MULTICURVES, MULTICURVES.getAllNames());
    final SimpleParameterSensitivity psFD = PSMQCS_FDC.calculateSensitivity(FX_SWAP, MULTICURVES);
    AssertSensivityObjects.assertEquals("CashDiscountingProviderMethod: presentValueCurveSensitivity ", psFD, psComputed, TOLERANCE_RATE_DELTA);
  }
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.