Package com.opengamma.analytics.util.amount

Examples of com.opengamma.analytics.util.amount.StringAmount


  @Test
  /**
   * Tests the present value curve sensitivity to parallel curve movements of fixed coupons.
   */
  public void presentValueParallelCurveSensitivity() {
    final StringAmount pvpcsComputed = METHOD.presentValueParallelCurveSensitivity(CPN_PAY, YC_BUNDLE);
    final double pvpcsExpected = -CPN_PAY.getPaymentTime() * CPN_PAY.getAmount() * YC_BUNDLE.getCurve(CURVES_NAME[0]).getDiscountFactor(CPN_PAY.getPaymentTime());
    assertEquals("CouponFixed: Present value parallel curve sensitivity by discounting", 1, pvpcsComputed.getMap().size());
    assertEquals("CouponFixed: Present value parallel curve sensitivity by discounting", pvpcsExpected, pvpcsComputed.getMap().get(CURVES_NAME[0]), 1.0E-2);
  }
View Full Code Here


  @Test
  /**
   * Tests the present value curve sensitivity to parallel curve movements of fixed coupons.
   */
  public void presentValueParallelCurveSensitivityMethodVsCalculator() {
    final StringAmount pvpcsMethod = METHOD.presentValueParallelCurveSensitivity(CPN_PAY, YC_BUNDLE);
    final StringAmount pvpcsCalculator = CPN_PAY.accept(PVPCSC, YC_BUNDLE);
    assertTrue("CouponFixed: Present value parallel curve sensitivity by discounting", StringAmount.compare(pvpcsMethod, pvpcsCalculator, 1.0E-5));
  }
View Full Code Here

  @Test
  /**
   * Tests the present value curve sensitivity to parallel curve movements of fixed payments.
   */
  public void presentValueParallelCurveSensitivity() {
    final StringAmount pvpcsComputed = METHOD.presentValueParallelCurveSensitivity(PAYMENT, YC_BUNDLE);
    final double pvpcsExpected = -PAYMENT.getPaymentTime() * PAYMENT.getAmount() * YC_BUNDLE.getCurve(CURVES_NAME[0]).getDiscountFactor(PAYMENT.getPaymentTime());
    assertEquals("CouponFixed: Present value parallel curve sensitivity by discounting", 1, pvpcsComputed.getMap().size());
    assertEquals("CouponFixed: Present value parallel curve sensitivity by discounting", pvpcsExpected, pvpcsComputed.getMap().get(CURVES_NAME[0]), 1.0E-2);
  }
View Full Code Here

  @Test
  /**
   * Tests the present value curve sensitivity to parallel curve movements of fixed payments.
   */
  public void presentValueParallelCurveSensitivityMethodVsCalculator() {
    final StringAmount pvpcsMethod = METHOD.presentValueParallelCurveSensitivity(PAYMENT, YC_BUNDLE);
    final StringAmount pvpcsCalculator = PAYMENT.accept(PVPCSC, YC_BUNDLE);
    assertTrue("CouponFixed: Present value parallel curve sensitivity by discounting", StringAmount.compare(pvpcsMethod, pvpcsCalculator, 1.0E-5));
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.util.amount.StringAmount

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.