Examples of HazardRateCurve


Examples of com.opengamma.analytics.financial.credit.hazardratecurve.HazardRateCurve

    final int len = HR_DATES.length;
    for (int i = 0; i < len; i++) {
      hrDates[i] = HR_DATES[i].plusDays(12);
      hrTimes[i] = DAY_COUNT.getDayCountFraction(BASE_DATE, hrDates[i]);
    }
    final HazardRateCurve hazardRateCurve = new HazardRateCurve(hrDates, hrTimes, HR_RATES, OFFSET);

    CALCULATOR.constructCreditDefaultSwapAccruedLegIntegrationSchedule(VALUATION_DATE, cds1, YIELD_CURVE, hazardRateCurve, true);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.credit.hazardratecurve.HazardRateCurve

    final int len = HR_DATES.length;
    for (int i = 0; i < len; i++) {
      hrDates[i] = HR_DATES[i].plusDays(12);
      hrTimes[i] = DAY_COUNT.getDayCountFraction(BASE_DATE, hrDates[i]);
    }
    final HazardRateCurve hazardRateCurve = new HazardRateCurve(hrDates, hrTimes, HR_RATES, OFFSET);
    final ISDADateCurve yc = null;

    CALCULATOR.constructCreditDefaultSwapAccruedLegIntegrationSchedule(VALUATION_DATE, cds1, yc, hazardRateCurve, true);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.credit.hazardratecurve.HazardRateCurve

  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void accLegNullHazardTest() {
    final CreditDefaultSwapDefinition cds1 = CreditDefaultSwapDefinitionDataSets.getLegacyVanillaDefinition().withMaturityDate(VALUATION_DATE.plusYears(10));
    final HazardRateCurve hazardRateCurve = null;

    CALCULATOR.constructCreditDefaultSwapAccruedLegIntegrationSchedule(VALUATION_DATE, cds1, YIELD_CURVE, hazardRateCurve, true);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.credit.hazardratecurve.HazardRateCurve

    final int len = HR_DATES.length;
    for (int i = 0; i < len; i++) {
      hrDates[i] = HR_DATES[i].plusDays(12);
      hrTimes[i] = DAY_COUNT.getDayCountFraction(BASE_DATE, hrDates[i]);
    }
    final HazardRateCurve hazardRateCurve = new HazardRateCurve(hrDates, hrTimes, HR_RATES, OFFSET);
    ZonedDateTime startDate = getStartDate(cds);
    final ZonedDateTime endDate = cds.getMaturityDate();

    final int lenExp = hrDates.length - 1 + YC_DATES.length - 1 + 2;
    final DayCount act365 = DayCountFactory.INSTANCE.getDayCount("ACT/365");
    final double[] ans = new double[lenExp];
    for (int i = 0; i < YC_DATES.length - 1; i++) {
      ans[i * 2 + 1] = YIELD_CURVE.getTimePoints()[i];
    }
    for (int i = 0; i < hrDates.length - 1; i++) {
      ans[i * 2 + 2] = hazardRateCurve.getShiftedTimePoints()[i];
    }
    ans[0] = TimeCalculator.getTimeBetween(VALUATION_DATE, startDate, act365);
    ans[lenExp - 1] = TimeCalculator.getTimeBetween(VALUATION_DATE, endDate, act365);
    double[] res = CALCULATOR.constructCreditDefaultSwapContingentLegIntegrationSchedule(VALUATION_DATE, startDate, endDate, cds, YIELD_CURVE, hazardRateCurve);
    assertEquals(lenExp, res.length);
View Full Code Here

Examples of com.opengamma.analytics.financial.credit.hazardratecurve.HazardRateCurve

    }
  }

  @Test
  public void testCngLegWithFixedCurve() {
    final HazardRateCurve hrCurve = new HazardRateCurve(HR_DATES, HR_TIMES, HR_RATES, OFFSET);
    for (int j = 1; j < 25; j += 3) {
      CreditDefaultSwapDefinition cds = CreditDefaultSwapDefinitionDataSets.getLegacyVanillaDefinitionWithProtectionStart(true)
          .withMaturityDate(YC_DATES[YC_DATES.length - 1].minusMonths(1))
          .withEffectiveDate(VALUATION_DATE.minusMonths(1).plusDays(j))
          .withStartDate(VALUATION_DATE.minusMonths(1));
View Full Code Here

Examples of com.opengamma.analytics.financial.credit.hazardratecurve.HazardRateCurve

    final int len = HR_DATES.length;
    for (int i = 0; i < len; i++) {
      hrDates[i] = HR_DATES[i].plusDays(12);
      hrTimes[i] = DAY_COUNT.getDayCountFraction(BASE_DATE, hrDates[i]);
    }
    final HazardRateCurve hazardRateCurve = new HazardRateCurve(hrDates, hrTimes, HR_RATES, OFFSET);
    final ZonedDateTime startDate = getStartDate(cds);
    final ZonedDateTime endDate = cds.getMaturityDate();
    final CreditDefaultSwapDefinition cdsNull = null;

    CALCULATOR.constructCreditDefaultSwapContingentLegIntegrationSchedule(VALUATION_DATE, startDate, endDate, cdsNull, YIELD_CURVE, hazardRateCurve);
View Full Code Here

Examples of com.opengamma.analytics.financial.credit.hazardratecurve.HazardRateCurve

    final int len = HR_DATES.length;
    for (int i = 0; i < len; i++) {
      hrDates[i] = HR_DATES[i].plusDays(12);
      hrTimes[i] = DAY_COUNT.getDayCountFraction(BASE_DATE, hrDates[i]);
    }
    final HazardRateCurve hazardRateCurve = new HazardRateCurve(hrDates, hrTimes, HR_RATES, OFFSET);
    final ZonedDateTime startDate = getStartDate(cds);
    final ZonedDateTime endDate = cds.getMaturityDate();
    final ISDADateCurve yc = null;

    CALCULATOR.constructCreditDefaultSwapContingentLegIntegrationSchedule(VALUATION_DATE, startDate, endDate, cds, yc, hazardRateCurve);
View Full Code Here

Examples of com.opengamma.analytics.financial.credit.hazardratecurve.HazardRateCurve

  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void cngLegNullHazardTest() {
    final CreditDefaultSwapDefinition cds = CreditDefaultSwapDefinitionDataSets.getLegacyVanillaDefinition().withMaturityDate(VALUATION_DATE.plusYears(10));
    final HazardRateCurve hazardRateCurve = null;
    final ZonedDateTime startDate = getStartDate(cds);
    final ZonedDateTime endDate = cds.getMaturityDate();

    CALCULATOR.constructCreditDefaultSwapContingentLegIntegrationSchedule(VALUATION_DATE, startDate, endDate, cds, YIELD_CURVE, hazardRateCurve);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.credit.hazardratecurve.HazardRateCurve

    final int len = HR_DATES.length;
    for (int i = 0; i < len; i++) {
      hrDates[i] = HR_DATES[i].plusDays(12);
      hrTimes[i] = DAY_COUNT.getDayCountFraction(BASE_DATE, hrDates[i]);
    }
    final HazardRateCurve hazardRateCurve = new HazardRateCurve(hrDates, hrTimes, HR_RATES, OFFSET);
    final ZonedDateTime startDate = getStartDate(cds);
    final ZonedDateTime endDate = cds.getMaturityDate();

    CALCULATOR.constructCreditDefaultSwapContingentLegIntegrationSchedule(VALUATION_DATE, endDate, startDate, cds, YIELD_CURVE, hazardRateCurve);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.credit.hazardratecurve.HazardRateCurve

    final int len = HR_DATES.length;
    for (int i = 0; i < len; i++) {
      hrDates[i] = HR_DATES[i].plusDays(12);
      hrTimes[i] = DAY_COUNT.getDayCountFraction(BASE_DATE, hrDates[i]);
    }
    final HazardRateCurve hazardRateCurve = new HazardRateCurve(hrDates, hrTimes, HR_RATES, OFFSET);
    final ZonedDateTime startDate = getStartDate(cds);
    final ZonedDateTime endDate = cds.getMaturityDate();
    final ZonedDateTime ev = DateUtils.getUTCDate(2043, 1, 6);

    CALCULATOR.constructCreditDefaultSwapContingentLegIntegrationSchedule(ev, endDate, startDate, cds, YIELD_CURVE, hazardRateCurve);
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.