Package com.opengamma.analytics.financial.provider.method

Examples of com.opengamma.analytics.financial.provider.method.SuccessiveLeastSquareLMMDDCalibrationObjective


    ArgumentChecker.notNull(sabrData, "SABR swaption provider");
    final Currency ccy = swaption.getCurrency();
    final MulticurveProviderInterface multicurves = sabrData.getMulticurveProvider();
    final int nbStrikes = _strikeMoneyness.length;
    final LiborMarketModelDisplacedDiffusionParameters lmmParameters = _parametersInit.copy();
    final SuccessiveLeastSquareLMMDDCalibrationObjective objective = new SuccessiveLeastSquareLMMDDCalibrationObjective(lmmParameters, ccy);
    final SuccessiveLeastSquareLMMDDCalibrationEngine<SABRSwaptionProviderInterface> calibrationEngine = new SuccessiveLeastSquareLMMDDCalibrationEngine<>(objective, nbStrikes);
    final SwaptionPhysicalFixedIbor[] swaptionCalibration = METHOD_BASKET.calibrationBasketFixedLegPeriod(swaption, _strikeMoneyness);
    calibrationEngine.addInstrument(swaptionCalibration, PVSSC);
    calibrationEngine.calibrate(sabrData);
    final LiborMarketModelDisplacedDiffusionProvider lmm = new LiborMarketModelDisplacedDiffusionProvider(multicurves, lmmParameters, ccy);
View Full Code Here


    ArgumentChecker.notNull(sabrData, "SABR swaption provider");
    final Currency ccy = swaption.getCurrency();
    final MulticurveProviderInterface multicurves = sabrData.getMulticurveProvider();
    final int nbStrikes = _strikeMoneyness.length;
    final LiborMarketModelDisplacedDiffusionParameters lmmParameters = _parametersInit.copy();
    final SuccessiveLeastSquareLMMDDCalibrationObjective objective = new SuccessiveLeastSquareLMMDDCalibrationObjective(lmmParameters, ccy);
    final SuccessiveLeastSquareLMMDDCalibrationEngine<SABRSwaptionProviderInterface> calibrationEngine = new SuccessiveLeastSquareLMMDDCalibrationEngine<>(objective, nbStrikes);
    final SwaptionPhysicalFixedIbor[] swaptionCalibration = METHOD_BASKET.calibrationBasketFixedLegPeriod(swaption, _strikeMoneyness);
    calibrationEngine.addInstrument(swaptionCalibration, PVSSC);
    calibrationEngine.calibrate(sabrData);
    final LiborMarketModelDisplacedDiffusionProvider lmm = new LiborMarketModelDisplacedDiffusionProvider(multicurves, lmmParameters, ccy);
View Full Code Here

    ArgumentChecker.notNull(sabrData, "SABR swaption provider");
    final Currency ccy = swaption.getCurrency();
    final MulticurveProviderInterface multicurves = sabrData.getMulticurveProvider();
    final int nbStrikes = _strikeMoneyness.length;
    final LiborMarketModelDisplacedDiffusionParameters lmmParameters = _parametersInit.copy();
    final SuccessiveLeastSquareLMMDDCalibrationObjective objective = new SuccessiveLeastSquareLMMDDCalibrationObjective(lmmParameters, ccy);
    final SuccessiveLeastSquareLMMDDCalibrationEngine<SABRSwaptionProviderInterface> calibrationEngine = new SuccessiveLeastSquareLMMDDCalibrationEngine<>(objective, nbStrikes);
    final SwaptionPhysicalFixedIbor[] swaptionCalibration = METHOD_BASKET.calibrationBasketFixedLegPeriod(swaption, _strikeMoneyness);
    calibrationEngine.addInstrument(swaptionCalibration, PVSSC);
    calibrationEngine.calibrate(sabrData);
    final LiborMarketModelDisplacedDiffusionProvider lmm = new LiborMarketModelDisplacedDiffusionProvider(multicurves, lmmParameters, ccy);
View Full Code Here

  /**
   * Tests the correctness of LMM DD calibration to swaptions with SABR price.
   */
  public void calibration() {
    final LiborMarketModelDisplacedDiffusionParameters lmmParameters = LMM_PARAM_INIT.copy();
    final SuccessiveLeastSquareLMMDDCalibrationObjective objective = new SuccessiveLeastSquareLMMDDCalibrationObjective(lmmParameters, EUR);
    final CalibrationEngineWithCalculators<SABRSwaptionProviderInterface> calibrationEngine = new SuccessiveLeastSquareLMMDDCalibrationEngine<>(objective, NB_STRIKE);
    final SwaptionPhysicalFixedIbor[] swaptionCalibration = METHOD_BASKET.calibrationBasketFixedLegPeriod(SWAPTION_AMORTIZED, MONEYNESS);
    calibrationEngine.addInstrument(swaptionCalibration, PVSSC);
    calibrationEngine.calibrate(SABR_MULTICURVES);
    final MultipleCurrencyAmount[][] pvSabr = new MultipleCurrencyAmount[SWAP_TENOR_YEAR.length][NB_STRIKE];
    final MultipleCurrencyAmount[][] pvLmm = new MultipleCurrencyAmount[SWAP_TENOR_YEAR.length][NB_STRIKE];
    final double[][] pvDiff = new double[SWAP_TENOR_YEAR.length][NB_STRIKE];
    final double[] pvDiffTot = new double[SWAP_TENOR_YEAR.length];
    for (int loopexp = 0; loopexp < SWAP_TENOR_YEAR.length; loopexp++) {
      for (int loopstrike = 0; loopstrike < NB_STRIKE; loopstrike++) {
        pvSabr[loopexp][loopstrike] = METHOD_SABR.presentValue(swaptionCalibration[loopexp * NB_STRIKE + loopstrike], SABR_MULTICURVES);
        pvLmm[loopexp][loopstrike] = METHOD_LMM.presentValue(swaptionCalibration[loopexp * NB_STRIKE + loopstrike], objective.getLMMProvider());
        pvDiff[loopexp][loopstrike] = pvSabr[loopexp][loopstrike].getAmount(EUR) - pvLmm[loopexp][loopstrike].getAmount(EUR);
        pvDiffTot[loopexp] += pvDiff[loopexp][loopstrike];
      }
      assertEquals("LMM calibration least-square: swaption " + loopexp, 0, pvDiffTot[loopexp], TOLERANCE_LS);
    }
    // Comparison with method
    final MultipleCurrencyAmount pvDirect = METHOD_LMM.presentValue(SWAPTION_AMORTIZED, objective.getLMMProvider());
    final MultipleCurrencyAmount pvMethod = METHOD_CALIBRATION.presentValue(SWAPTION_AMORTIZED, SABR_MULTICURVES);
    assertEquals("LMM calibration least-square: swaption ", pvDirect.getAmount(EUR), pvMethod.getAmount(EUR), TOLERANCE_PV);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.provider.method.SuccessiveLeastSquareLMMDDCalibrationObjective

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.