Examples of cleaned()


Examples of com.opengamma.analytics.financial.interestrate.InterestRateCurveSensitivity.cleaned()

  @Test
  public void parRateCurveSensitivity() {
    InterestRateCurveSensitivity prcsComputed = METHOD_CPN_IBOR_SPREAD.parRateCurveSensitivity(CPN_IBOR_SPREAD, CURVES);
    prcsComputed = prcsComputed.cleaned();
    InterestRateCurveSensitivity prcsIbor = METHOD_CPN_IBOR.parRateCurveSensitivity(CPN_IBOR, CURVES);
    prcsIbor = prcsIbor.cleaned();
    AssertSensivityObjects.assertEquals("CouponIborSpreadDiscountingMethod: present value curve sensitivity", prcsIbor, prcsComputed, TOLERANCE_PV);
  }
}
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.InterestRateCurveSensitivity.cleaned()

  /**
   * Tests the price curve sensitivity of cap/floor Ibor with Hull-White. Values are tested against finite difference values.
   */
  public void presentValueCurveSensitivityCap() {
    InterestRateCurveSensitivity pvcsCap = METHOD_HW.presentValueCurveSensitivity(CAP_LONG, BUNDLE_HW);
    pvcsCap = pvcsCap.cleaned();
    final double deltaShift = 1.0E-6;
    final String bumpedCurveName = "Bumped Curve";
    // 1. Forward curve sensitivity
    final String[] CurveNameBumpedForward = {CURVES_NAME[0], bumpedCurveName};
    final CapFloorIbor capBumpedForward = (CapFloorIbor) CAP_LONG_DEFINITION.toDerivative(REFERENCE_DATE, CurveNameBumpedForward);
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.InterestRateCurveSensitivity.cleaned()

    // Swaption sensitivity
    InterestRateCurveSensitivity pvsReceiver = METHOD.presentValueCurveSensitivity(CMS_COUPON_RECEIVER, sabrBundle);
    // Present value sensitivity comparison with finite difference.
    final double deltaTolerance = 1E+2; //Sensitivity is for a movement of 1. 1E+2 = 1 cent for a 1 bp move.
    final double deltaShift = 1e-9;
    pvsReceiver = pvsReceiver.cleaned();
    final double pv = METHOD.presentValue(CMS_COUPON_RECEIVER, sabrBundle).getAmount();
    // 1. Forward curve sensitivity
    final String bumpedCurveName = "Bumped Curve";
    final String[] bumpedCurvesForwardName = {FUNDING_CURVE_NAME, bumpedCurveName };
    final CouponCMS cmsBumpedForward = (CouponCMS) CMS_COUPON_RECEIVER_DEFINITION.toDerivative(REFERENCE_DATE, bumpedCurvesForwardName);
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.InterestRateCurveSensitivity.cleaned()

  /**
   * Tests the price curve sensitivity of CMS coupon and cap/floor using replication in the SABR framework. Values are tested against finite difference values.
   */
  public void presentValueCurveSensitivityCap() {
    InterestRateCurveSensitivity pvcsCap = METHOD_CMS_SPREAD.presentValueCurveSensitivity(CMS_CAP_SPREAD, SABR_BUNDLE);
    pvcsCap = pvcsCap.cleaned();
    final double deltaToleranceRelative = 2.5E-4; // Numerical imprecision, reduce to E-6 when nbInteration = 1000;
    final double deltaShift = 1.0E-6;
    final String bumpedCurveName = "Bumped Curve";
    // 1. Forward curve sensitivity
    final String[] CurveNameBumpedForward = {FUNDING_CURVE_NAME, bumpedCurveName };
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.InterestRateCurveSensitivity.cleaned()

  /**
   * Tests the price curve sensitivity of CMS coupon and cap/floor using replication in the SABR framework. Values are tested against finite difference values.
   */
  public void presentValueCurveSensitivityCapExtrapolation() {
    InterestRateCurveSensitivity pvcsCap = METHOD_CMS_SPREAD_EXTRAPOLATION.presentValueCurveSensitivity(CMS_CAP_SPREAD, SABR_BUNDLE);
    pvcsCap = pvcsCap.cleaned();
    final double deltaToleranceRelative = 2.5E-4; // Numerical imprecision, reduce to E-6 when nbInteration = 1000;
    final double deltaShift = 1.0E-6;
    final String bumpedCurveName = "Bumped Curve";
    // 1. Forward curve sensitivity
    final String[] CurveNameBumpedForward = {FUNDING_CURVE_NAME, bumpedCurveName };
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.InterestRateCurveSensitivity.cleaned()

    final YieldCurveBundle curvesUp = TestsDataSetsSABR.createCurves2();
    final SABRInterestRateDataBundle sabrBundleCurveUp = new SABRInterestRateDataBundle(SABR_PARAMETERS, curvesUp);
    final String[] curvesUpName = TestsDataSetsSABR.curves2Names();
    final CapFloorCMSSpread cmsCapSpread = (CapFloorCMSSpread) CMS_CAP_SPREAD_DEFINITION.toDerivative(REFERENCE_DATE, new String[] {curvesUpName[0], curvesUpName[1] });
    InterestRateCurveSensitivity pvcsCap = METHOD_CMS_SPREAD.presentValueCurveSensitivity(cmsCapSpread, sabrBundleCurveUp);
    pvcsCap = pvcsCap.cleaned();
    final double deltaToleranceRelative = 3.0E-4; // Numerical imprecision, reduce to E-6 when nbInteration = 1000;
    final double deltaShift = 1.0E-6;
    final String bumpedCurveName = "Bumped Curve";
    // 1. Forward curve sensitivity
    final String[] CurveNameBumpedForward = {curvesUpName[0], bumpedCurveName };
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.InterestRateCurveSensitivity.cleaned()

  /**
   * Tests the price curve sensitivity of CMS coupon and cap/floor using replication in the SABR framework. Values are tested against finite difference values.
   */
  public void presentValueCurveSensitivityFloor() {
    InterestRateCurveSensitivity pvcsFloor = METHOD_CMS_SPREAD.presentValueCurveSensitivity(CMS_FLOOR_SPREAD, SABR_BUNDLE);
    pvcsFloor = pvcsFloor.cleaned();
    final double deltaToleranceRelative = 7.0E-4; // Numerical imprecision, reduce to E-6 when nbInteration = 1000;
    final double deltaShift = 1.0E-6;
    final String bumpedCurveName = "Bumped Curve";
    // 1. Forward curve sensitivity
    final String[] CurveNameBumpedForward = {FUNDING_CURVE_NAME, bumpedCurveName };
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.InterestRateCurveSensitivity.cleaned()

        STRIKE,
        IS_CAP, FUNDING_CURVE_NAME);
    final SABRInterestRateCorrelationParameters sabrCorrelation = SABRInterestRateCorrelationParameters.from(SABR_PARAMETERS, CORRELATION_FUNCTION);
    final SABRInterestRateDataBundle sabrBundleCor = new SABRInterestRateDataBundle(sabrCorrelation, CURVES);
    InterestRateCurveSensitivity pvcsLong = METHOD_CMS_SPREAD.presentValueCurveSensitivity(CMS_CAP_SPREAD, sabrBundleCor);
    pvcsLong = pvcsLong.cleaned();
    InterestRateCurveSensitivity pvcsShort = METHOD_CMS_SPREAD.presentValueCurveSensitivity(cmsCapSpreadShort, sabrBundleCor);
    pvcsShort = pvcsShort.multipliedBy(-1);
    pvcsShort = pvcsShort.cleaned();
    AssertSensivityObjects.assertEquals("CMS cap spread: Long/Short parity", pvcsLong, pvcsShort, TOLERANCE_PRICE);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.InterestRateCurveSensitivity.cleaned()

    final SABRInterestRateDataBundle sabrBundleCor = new SABRInterestRateDataBundle(sabrCorrelation, CURVES);
    InterestRateCurveSensitivity pvcsLong = METHOD_CMS_SPREAD.presentValueCurveSensitivity(CMS_CAP_SPREAD, sabrBundleCor);
    pvcsLong = pvcsLong.cleaned();
    InterestRateCurveSensitivity pvcsShort = METHOD_CMS_SPREAD.presentValueCurveSensitivity(cmsCapSpreadShort, sabrBundleCor);
    pvcsShort = pvcsShort.multipliedBy(-1);
    pvcsShort = pvcsShort.cleaned();
    AssertSensivityObjects.assertEquals("CMS cap spread: Long/Short parity", pvcsLong, pvcsShort, TOLERANCE_PRICE);
  }

  @Test
  /**
 
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.InterestRateCurveSensitivity.cleaned()

        STRIKE,
        !IS_CAP, FUNDING_CURVE_NAME);
    final SABRInterestRateCorrelationParameters sabrCorrelation = SABRInterestRateCorrelationParameters.from(SABR_PARAMETERS, CORRELATION_FUNCTION);
    final SABRInterestRateDataBundle sabrBundleCor = new SABRInterestRateDataBundle(sabrCorrelation, CURVES);
    InterestRateCurveSensitivity pvcsLong = METHOD_CMS_SPREAD.presentValueCurveSensitivity(CMS_FLOOR_SPREAD, sabrBundleCor);
    pvcsLong = pvcsLong.cleaned();
    InterestRateCurveSensitivity pvcsShort = METHOD_CMS_SPREAD.presentValueCurveSensitivity(cmsCapSpreadShort, sabrBundleCor);
    pvcsShort = pvcsShort.multipliedBy(-1);
    pvcsShort = pvcsShort.cleaned();
    AssertSensivityObjects.assertEquals("CMS floor spread: Long/Short parity", pvcsLong, pvcsShort, TOLERANCE_PRICE);
  }
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.