Examples of CouponInflationYearOnYearInterpolation


Examples of com.opengamma.analytics.financial.interestrate.inflation.derivative.CouponInflationYearOnYearInterpolation

    referenceEndTime[1] = TimeCalculator.getTimeBetween(date, getReferenceEndDate()[1]);
    final ZonedDateTime naturalPaymentEndDate = getPaymentDate().minusMonths(_monthLag - _conventionalMonthLag);
    final double naturalPaymentEndTime = TimeCalculator.getTimeBetween(date, naturalPaymentEndDate);
    final ZonedDateTime naturalPaymentstartDate = naturalPaymentEndDate.minusMonths(12);
    final double naturalPaymentStartTime = TimeCalculator.getTimeBetween(date, naturalPaymentstartDate);
    return new CouponInflationYearOnYearInterpolation(getCurrency(), paymentTime, getPaymentYearFraction(), getNotional(), getPriceIndex(), referenceStartTime, naturalPaymentStartTime,
        referenceEndTime,
        naturalPaymentEndTime, _payNotional, _weightStart, _weightEnd);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.inflation.derivative.CouponInflationYearOnYearInterpolation

    referenceEndTime[1] = TimeCalculator.getTimeBetween(date, getReferenceEndDate()[1]);
    final ZonedDateTime naturalPaymentEndDate = getPaymentDate().minusMonths(_monthLag - _conventionalMonthLag);
    final double naturalPaymentEndTime = TimeCalculator.getTimeBetween(date, naturalPaymentEndDate);
    final ZonedDateTime naturalPaymentstartDate = naturalPaymentEndDate.minusMonths(12);
    final double naturalPaymentStartTime = TimeCalculator.getTimeBetween(date, naturalPaymentstartDate);
    return new CouponInflationYearOnYearInterpolation(getCurrency(), paymentTime, getPaymentYearFraction(), getNotional(), getPriceIndex(), referenceStartTime, naturalPaymentStartTime,
        referenceEndTime,
        naturalPaymentEndTime, _payNotional, _weightStart, _weightEnd);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.inflation.derivative.CouponInflationYearOnYearInterpolation

    referenceStartTime[1] = TimeCalculator.getTimeBetween(date, _referenceStartDates[1]);
    final ZonedDateTime naturalPaymentEndDate = getPaymentDate().minusMonths(_monthLag - _conventionalMonthLag);
    final double naturalPaymentEndTime = TimeCalculator.getTimeBetween(date, naturalPaymentEndDate);
    final ZonedDateTime naturalPaymentstartDate = naturalPaymentEndDate.minusMonths(12);
    final double naturalPaymentStartTime = TimeCalculator.getTimeBetween(date, naturalPaymentstartDate);
    return new CouponInflationYearOnYearInterpolation(getCurrency(), paymentTime, getPaymentYearFraction(), getNotional(), getPriceIndex(), referenceStartTime, naturalPaymentStartTime,
        referenceEndTime, naturalPaymentEndTime, _payNotional, _weightStart, _weightEnd);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.inflation.derivative.CouponInflationYearOnYearInterpolation

    final double[] referenceEndTime = new double[2];
    referenceStartTime[0] = referenceStartTime0;
    referenceStartTime[1] = referenceStartTime1;
    referenceEndTime[0] = referenceEndTime0;
    referenceEndTime[1] = referenceEndTime1;
    final CouponInflationYearOnYearInterpolation yearOnYearCoupon = new CouponInflationYearOnYearInterpolation(CUR, paymentTime, 1.0, NOTIONAL, PRICE_INDEX, referenceStartTime,
        naturalPaymentStartPaymentTime, referenceEndTime, naturalPaymentEndPaymentTime, false, WEIGHT_START, WEIGHT_END);
    assertEquals("Inflation year on year coupon: toDerivative", yearOnYearCouponConverted, yearOnYearCoupon);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.inflation.derivative.CouponInflationYearOnYearInterpolation

    final double[] referenceEndTime = new double[2];
    referenceStartTime[0] = referenceStartTime0;
    referenceStartTime[1] = referenceStartTime1;
    referenceEndTime[0] = referenceEndTime0;
    referenceEndTime[1] = referenceEndTime1;
    final CouponInflationYearOnYearInterpolation yearOnYearCoupon = new CouponInflationYearOnYearInterpolation(CUR, paymentTime, 1.0, NOTIONAL, PRICE_INDEX, referenceStartTime,
        naturalPaymentStartPaymentTime, referenceEndTime, naturalPaymentEndPaymentTime, false, WEIGHT_START, WEIGHT_END);
    assertEquals("Inflation zero-coupon: toDerivative", yearOnYearCoupon, yearOnYearCouponConverted);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.inflation.derivative.CouponInflationYearOnYearInterpolation

  private static final CouponInflationYearOnYearInterpolation YoY_COUPON = new CouponInflationYearOnYearInterpolation(CUR, PAYMENT_TIME, 1.0, NOTIONAL, PRICE_INDEX, REFERENCE_START_TIME,
      NATURAL_PAYMENT_START_TIME, REFERENCE_END_TIME, NATURAL_PAYMENT_END_TIME, false, WEIGHT_START, WEIGHT_END);

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNullIndex() {
    new CouponInflationYearOnYearInterpolation(CUR, PAYMENT_TIME, 1.0, NOTIONAL, null, REFERENCE_START_TIME,
        NATURAL_PAYMENT_START_TIME, REFERENCE_END_TIME, NATURAL_PAYMENT_END_TIME, false, WEIGHT_START, WEIGHT_END);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.inflation.derivative.CouponInflationYearOnYearInterpolation

  /**
   * Tests the equal and hash-code methods.
   */
  public void equalHash() {
    assertEquals(YoY_COUPON, YoY_COUPON);
    CouponInflationYearOnYearInterpolation couponDuplicate = new CouponInflationYearOnYearInterpolation(CUR, PAYMENT_TIME, 1.0, NOTIONAL, PRICE_INDEX, REFERENCE_START_TIME,
        NATURAL_PAYMENT_START_TIME, REFERENCE_END_TIME, NATURAL_PAYMENT_END_TIME, false, WEIGHT_START, WEIGHT_END);
    assertEquals(YoY_COUPON, couponDuplicate);
    assertEquals(YoY_COUPON.hashCode(), couponDuplicate.hashCode());
    CouponInflationYearOnYearInterpolation modified;
    final double[] modifiedReferenceStartTime = new double[2];
    modifiedReferenceStartTime[0] = REFERENCE_START_TIME[0];
    modifiedReferenceStartTime[1] = REFERENCE_START_TIME[1] + 0.1;
    modified = new CouponInflationYearOnYearInterpolation(CUR, PAYMENT_TIME, 1.0, NOTIONAL, PRICE_INDEX, modifiedReferenceStartTime,
        NATURAL_PAYMENT_START_TIME, REFERENCE_END_TIME, NATURAL_PAYMENT_END_TIME, false, WEIGHT_START, WEIGHT_END);
    assertFalse(YoY_COUPON.equals(modified));
    final double[] modifiedReferenceEndTime = new double[2];
    modifiedReferenceEndTime[0] = REFERENCE_END_TIME[0];
    modifiedReferenceEndTime[1] = REFERENCE_END_TIME[1] + 0.1;
    modified = new CouponInflationYearOnYearInterpolation(CUR, PAYMENT_TIME, 1.0, NOTIONAL, PRICE_INDEX, REFERENCE_START_TIME,
        NATURAL_PAYMENT_START_TIME, modifiedReferenceEndTime, NATURAL_PAYMENT_END_TIME, false, WEIGHT_START, WEIGHT_END);
    assertFalse(YoY_COUPON.equals(modified));
    final double modifiedNaturalPaymentStartTime = NATURAL_PAYMENT_START_TIME + .01;
    modified = new CouponInflationYearOnYearInterpolation(CUR, PAYMENT_TIME, 1.0, NOTIONAL, PRICE_INDEX, REFERENCE_START_TIME,
        modifiedNaturalPaymentStartTime, REFERENCE_END_TIME, NATURAL_PAYMENT_END_TIME, false, WEIGHT_START, WEIGHT_END);
    assertFalse(YoY_COUPON.equals(modified));
    final double modifiedNaturalPaymentEndTime = NATURAL_PAYMENT_END_TIME + .01;
    modified = new CouponInflationYearOnYearInterpolation(CUR, PAYMENT_TIME, 1.0, NOTIONAL, PRICE_INDEX, REFERENCE_START_TIME,
        NATURAL_PAYMENT_START_TIME, REFERENCE_END_TIME, modifiedNaturalPaymentEndTime, false, WEIGHT_START, WEIGHT_END);
    assertFalse(YoY_COUPON.equals(modified));

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.