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

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


    for (int loopexp = 0; loopexp < CAPS[0][availabelTenor.length - 1].getNumberOfPayments(); loopexp++) {
      final CapFloorInflationYearOnYearInterpolation cap = (CapFloorInflationYearOnYearInterpolation) CAPS[0][availabelTenor.length - 1].getNthPayment(loopexp);
      expiryTimes[loopexp] = cap.getReferenceEndTime()[1];
    }
    final InflationYearOnYearCapFloorParameters parameters = new InflationYearOnYearCapFloorParameters(expiryTimes, strikes, volatilities, PRICE_INDEX_EUR);
    final SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationObjective objective = new SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationObjective(parameters, CUR);
    final SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationEngine<InflationProviderInterface> calibrationEngine = new SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationEngine<>(
        objective);
    for (int loop1 = 0; loop1 < strikes.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {
        for (int loop3 = 0; loop3 < CAPS[loop1][loop2].getNumberOfPayments(); loop3++) {
          marketPrices[loop1][loop2][loop3] = METHOD.presentValue(CAPS[loop1][loop2].getNthPayment(loop3), BLACK_INFLATION).getAmount(CUR);
        }
      }
    }

    for (int loop1 = 0; loop1 < strikes.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {
        for (int loop3 = 0; loop3 < CAPS[loop1][loop2].getNumberOfPayments(); loop3++) {
          calibrationEngine.addInstrument(CAPS[loop1][loop2].getNthPayment(loop3), marketPrices[loop1][loop2][loop3]);
        }
      }
    }
    calibrationEngine.calibrate(MARKET.getInflationProvider());
    final MultipleCurrencyAmount[][][] pvCapYearOnYear = new MultipleCurrencyAmount[STRIKES.length][availabelTenor.length][30];
    for (int loop1 = 0; loop1 < strikes.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {
        for (int loop3 = 0; loop3 < CAPS[loop1][loop2].getNumberOfPayments(); loop3++) {
          final Interpolator2D interpolator = objective.getInflationCapYearOnYearProvider().getBlackParameters().getVolatilitySurface().getInterpolator();
          final BlackSmileCapInflationYearOnYearParameters CalibratedBlackSmileCapInflationYearOnYearParameters = new BlackSmileCapInflationYearOnYearParameters(
              objective.getInflationCapYearOnYearParameters(), interpolator);
          final BlackSmileCapInflationYearOnYearProvider CalibratedBlackSmileCapInflationYearOnYearProvider = new BlackSmileCapInflationYearOnYearProvider(objective
              .getInflationCapYearOnYearProvider().getInflationProvider(),
              CalibratedBlackSmileCapInflationYearOnYearParameters);
          pvCapYearOnYear[loop1][loop2][loop3] = METHOD.presentValue(CAPS[loop1][loop2].getNthPayment(loop3), CalibratedBlackSmileCapInflationYearOnYearProvider);
          assertEquals("Inflaiton year on year calibration: cap/floor " + loop1, pvCapYearOnYear[loop1][loop2][loop3].getAmount(CUR), marketPrices[loop1][loop2][loop3], 1E-2);
        }
View Full Code Here


    for (int loopexp = 0; loopexp < availabelTenor.length; loopexp++) {
      final CapFloorInflationYearOnYearInterpolation cap = (CapFloorInflationYearOnYearInterpolation) CAPS_AVAILABLE[0][loopexp].getNthPayment(CAPS_AVAILABLE[0][loopexp].getNumberOfPayments() - 1);
      expiryTimes_AVAILABLE[loopexp] = cap.getReferenceEndTime()[1];
    }
    final InflationYearOnYearCapFloorParameters parameters = new InflationYearOnYearCapFloorParameters(expiryTimes_AVAILABLE, strikes_AVAILABLE, volatilities_AVAILABLE, PRICE_INDEX_EUR);
    final SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationObjective objective = new SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationObjective(parameters, CUR);
    final SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationEngine<InflationProviderDiscount> calibrationEngine = new SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationEngine<>(
        objective);

    for (int loop1 = 0; loop1 < strikes_AVAILABLE.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {
        for (int loop3 = 0; loop3 < availabelTenor[loop2]; loop3++) {
          marketPrices_AVAILABLE[loop1][loop2] = marketPrices_AVAILABLE[loop1][loop2] + METHOD.presentValue(CAPS_AVAILABLE[loop1][loop2].getNthPayment(loop3), BLACK_INFLATION).getAmount(CUR);
        }
      }
    }

    for (int loop1 = 0; loop1 < strikes.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {

        calibrationEngine.addInstrument(CAPS_AVAILABLE[loop1][loop2], marketPrices_AVAILABLE[loop1][loop2]);

      }
    }
    calibrationEngine.calibrate(MARKET.getInflationProvider());
    final MultipleCurrencyAmount[][] pvCapYearOnYear = new MultipleCurrencyAmount[STRIKES.length][availabelTenor.length];
    for (int loop1 = 0; loop1 < strikes.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {

        final Interpolator2D interpolator = objective.getInflationCapYearOnYearProvider().getBlackParameters().getVolatilitySurface().getInterpolator();
        final BlackSmileCapInflationYearOnYearParameters CalibratedBlackSmileCapInflationYearOnYearParameters = new BlackSmileCapInflationYearOnYearParameters(
            objective.getInflationCapYearOnYearParameters(), interpolator);
        final BlackSmileCapInflationYearOnYearProvider CalibratedBlackSmileCapInflationYearOnYearProvider = new BlackSmileCapInflationYearOnYearProvider(objective
            .getInflationCapYearOnYearProvider().getInflationProvider(),
            CalibratedBlackSmileCapInflationYearOnYearParameters);
        pvCapYearOnYear[loop1][loop2] = METHOD.presentValue(CAPS_AVAILABLE[loop1][loop2].getNthPayment(0), CalibratedBlackSmileCapInflationYearOnYearProvider);
        for (int loop3 = 1; loop3 < CAPS_AVAILABLE[loop1][loop2].getNumberOfPayments(); loop3++) {
          pvCapYearOnYear[loop1][loop2] = pvCapYearOnYear[loop1][loop2]
View Full Code Here

    for (int loopexp = 0; loopexp < availabelTenor.length; loopexp++) {
      final CapFloorInflationYearOnYearInterpolation cap = (CapFloorInflationYearOnYearInterpolation) CAPS_AVAILABLE[0][loopexp].getNthPayment(CAPS_AVAILABLE[0][loopexp].getNumberOfPayments() - 1);
      expiryTimes_AVAILABLE[loopexp] = cap.getReferenceEndTime()[1];
    }
    final InflationYearOnYearCapFloorParameters parameters = new InflationYearOnYearCapFloorParameters(expiryTimes_AVAILABLE, strikes_AVAILABLE, volatilities_AVAILABLE, PRICE_INDEX_EUR);
    final SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationObjective objective = new SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationObjective(parameters, CUR);
    final SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationEngine<InflationProviderDiscount> calibrationEngine = new SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationEngine<>(
        objective);

    for (int loop1 = 0; loop1 < strikes_AVAILABLE.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {
        for (int loop3 = 0; loop3 < availabelTenor[loop2]; loop3++) {
          marketPrices_AVAILABLE[loop1][loop2] = marketPrices_AVAILABLE[loop1][loop2] + METHOD.presentValue(CAPS_AVAILABLE[loop1][loop2].getNthPayment(loop3), BLACK_INFLATION).getAmount(CUR);
        }
      }
    }

    for (int loop1 = 0; loop1 < strikes.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {

        calibrationEngine.addInstrument(CAPS_AVAILABLE[loop1][loop2], marketPrices_AVAILABLE[loop1][loop2]);

      }
    }
    calibrationEngine.calibrate(MARKET.getInflationProvider());
    final MultipleCurrencyAmount[][] pvCapYearOnYear = new MultipleCurrencyAmount[STRIKES.length][availabelTenor.length];
    for (int loop1 = 0; loop1 < strikes.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {

        final Interpolator2D interpolator = objective.getInflationCapYearOnYearProvider().getBlackParameters().getVolatilitySurface().getInterpolator();
        final BlackSmileCapInflationYearOnYearParameters CalibratedBlackSmileCapInflationYearOnYearParameters = new BlackSmileCapInflationYearOnYearParameters(
            objective.getInflationCapYearOnYearParameters(), interpolator);
        final BlackSmileCapInflationYearOnYearProvider CalibratedBlackSmileCapInflationYearOnYearProvider = new BlackSmileCapInflationYearOnYearProvider(objective
            .getInflationCapYearOnYearProvider().getInflationProvider(),
            CalibratedBlackSmileCapInflationYearOnYearParameters);
        pvCapYearOnYear[loop1][loop2] = METHOD.presentValue(CAPS_AVAILABLE[loop1][loop2].getNthPayment(0), CalibratedBlackSmileCapInflationYearOnYearProvider);
        for (int loop3 = 1; loop3 < CAPS_AVAILABLE[loop1][loop2].getNumberOfPayments(); loop3++) {
          pvCapYearOnYear[loop1][loop2] = pvCapYearOnYear[loop1][loop2]
View Full Code Here

    for (int loopexp = 0; loopexp < availabelTenor.length; loopexp++) {
      final CapFloorInflationYearOnYearInterpolation cap = (CapFloorInflationYearOnYearInterpolation) CAPS_AVAILABLE[0][loopexp].getNthPayment(CAPS_AVAILABLE[0][loopexp].getNumberOfPayments() - 1);
      expiryTimes_AVAILABLE[loopexp] = cap.getReferenceEndTime()[1];
    }
    final InflationYearOnYearCapFloorParameters parameters = new InflationYearOnYearCapFloorParameters(expiryTimes_AVAILABLE, strikes_AVAILABLE, volatilities_AVAILABLE, PRICE_INDEX_EUR);
    final SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationObjective objective = new SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationObjective(parameters, CUR);
    final SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationEngine<InflationProviderDiscount> calibrationEngine = new SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationEngine<>(
        objective);

    for (int loop1 = 0; loop1 < strikes_AVAILABLE.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {
View Full Code Here

    for (int loopexp = 0; loopexp < availabelTenor.length; loopexp++) {
      final CapFloorInflationYearOnYearMonthly cap = (CapFloorInflationYearOnYearMonthly) CAPS_AVAILABLE[0][loopexp].getNthPayment(CAPS_AVAILABLE[0][loopexp].getNumberOfPayments() - 1);
      expiryTimes_AVAILABLE[loopexp] = cap.getReferenceEndTime();
    }
    final InflationYearOnYearCapFloorParameters parameters = new InflationYearOnYearCapFloorParameters(expiryTimes_AVAILABLE, strikes_AVAILABLE, volatilities_AVAILABLE, PRICE_INDEX_EUR);
    final SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationObjective objective = new SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationObjective(parameters, CUR);
    final SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationEngine<InflationProviderDiscount> calibrationEngine = new SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationEngine<>(
        objective);

    for (int loop1 = 0; loop1 < strikes_AVAILABLE.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {
        for (int loop3 = 0; loop3 < availabelTenor[loop2]; loop3++) {
          marketPrices_AVAILABLE[loop1][loop2] = marketPrices_AVAILABLE[loop1][loop2] + METHOD.presentValue(CAPS_AVAILABLE[loop1][loop2].getNthPayment(loop3), BLACK_INFLATION).getAmount(CUR);
        }
      }
    }

    for (int loop1 = 0; loop1 < strikes.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {

        calibrationEngine.addInstrument(CAPS_AVAILABLE[loop1][loop2], marketPrices_AVAILABLE[loop1][loop2]);

      }
    }
    calibrationEngine.calibrate(MARKET.getInflationProvider());
    final MultipleCurrencyAmount[][] pvCapYearOnYear = new MultipleCurrencyAmount[STRIKES.length][availabelTenor.length];
    for (int loop1 = 0; loop1 < strikes.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {

        final Interpolator2D interpolator = objective.getInflationCapYearOnYearProvider().getBlackParameters().getVolatilitySurface().getInterpolator();
        final BlackSmileCapInflationYearOnYearParameters CalibratedBlackSmileCapInflationYearOnYearParameters = new BlackSmileCapInflationYearOnYearParameters(
            objective.getInflationCapYearOnYearParameters(), interpolator);
        final BlackSmileCapInflationYearOnYearProvider CalibratedBlackSmileCapInflationYearOnYearProvider = new BlackSmileCapInflationYearOnYearProvider(objective
            .getInflationCapYearOnYearProvider().getInflationProvider(),
            CalibratedBlackSmileCapInflationYearOnYearParameters);
        pvCapYearOnYear[loop1][loop2] = METHOD.presentValue(CAPS_AVAILABLE[loop1][loop2].getNthPayment(0), CalibratedBlackSmileCapInflationYearOnYearProvider);
        for (int loop3 = 1; loop3 < CAPS_AVAILABLE[loop1][loop2].getNumberOfPayments(); loop3++) {
          pvCapYearOnYear[loop1][loop2] = pvCapYearOnYear[loop1][loop2]
View Full Code Here

    for (int loopexp = 0; loopexp < availabelTenor.length; loopexp++) {
      final CapFloorInflationYearOnYearMonthly cap = (CapFloorInflationYearOnYearMonthly) CAPS_AVAILABLE[0][loopexp].getNthPayment(CAPS_AVAILABLE[0][loopexp].getNumberOfPayments() - 1);
      expiryTimes_AVAILABLE[loopexp] = cap.getReferenceEndTime();
    }
    final InflationYearOnYearCapFloorParameters parameters = new InflationYearOnYearCapFloorParameters(expiryTimes_AVAILABLE, strikes_AVAILABLE, volatilities_AVAILABLE, PRICE_INDEX_EUR);
    final SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationObjective objective = new SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationObjective(parameters, CUR);
    final SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationEngine<InflationProviderDiscount> calibrationEngine = new SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationEngine<>(
        objective);

    for (int loop1 = 0; loop1 < strikes_AVAILABLE.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {
        for (int loop3 = 0; loop3 < availabelTenor[loop2]; loop3++) {
          marketPrices_AVAILABLE[loop1][loop2] = marketPrices_AVAILABLE[loop1][loop2] + METHOD.presentValue(CAPS_AVAILABLE[loop1][loop2].getNthPayment(loop3), BLACK_INFLATION).getAmount(CUR);
        }
      }
    }

    for (int loop1 = 0; loop1 < strikes.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {

        calibrationEngine.addInstrument(CAPS_AVAILABLE[loop1][loop2], marketPrices_AVAILABLE[loop1][loop2]);

      }
    }
    calibrationEngine.calibrate(MARKET.getInflationProvider());
    final MultipleCurrencyAmount[][] pvCapYearOnYear = new MultipleCurrencyAmount[STRIKES.length][availabelTenor.length];
    for (int loop1 = 0; loop1 < strikes.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {

        final Interpolator2D interpolator = objective.getInflationCapYearOnYearProvider().getBlackParameters().getVolatilitySurface().getInterpolator();
        final BlackSmileCapInflationYearOnYearParameters CalibratedBlackSmileCapInflationYearOnYearParameters = new BlackSmileCapInflationYearOnYearParameters(
            objective.getInflationCapYearOnYearParameters(), interpolator);
        final BlackSmileCapInflationYearOnYearProvider CalibratedBlackSmileCapInflationYearOnYearProvider = new BlackSmileCapInflationYearOnYearProvider(objective
            .getInflationCapYearOnYearProvider().getInflationProvider(),
            CalibratedBlackSmileCapInflationYearOnYearParameters);
        pvCapYearOnYear[loop1][loop2] = METHOD.presentValue(CAPS_AVAILABLE[loop1][loop2].getNthPayment(0), CalibratedBlackSmileCapInflationYearOnYearProvider);
        for (int loop3 = 1; loop3 < CAPS_AVAILABLE[loop1][loop2].getNumberOfPayments(); loop3++) {
          pvCapYearOnYear[loop1][loop2] = pvCapYearOnYear[loop1][loop2]
View Full Code Here

    for (int loopexp = 0; loopexp < availabelTenor.length; loopexp++) {
      final CapFloorInflationYearOnYearMonthly cap = (CapFloorInflationYearOnYearMonthly) CAPS_AVAILABLE[0][loopexp].getNthPayment(CAPS_AVAILABLE[0][loopexp].getNumberOfPayments() - 1);
      expiryTimes_AVAILABLE[loopexp] = cap.getReferenceEndTime();
    }
    final InflationYearOnYearCapFloorParameters parameters = new InflationYearOnYearCapFloorParameters(expiryTimes_AVAILABLE, strikes_AVAILABLE, volatilities_AVAILABLE, PRICE_INDEX_EUR);
    final SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationObjective objective = new SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationObjective(parameters, CUR);
    final SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationEngine<InflationProviderDiscount> calibrationEngine = new SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationEngine<>(
        objective);

    for (int loop1 = 0; loop1 < strikes_AVAILABLE.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {
View Full Code Here

    for (int loopexp = 0; loopexp < CAPS[0][availabelTenor.length - 1].getNumberOfPayments(); loopexp++) {
      final CapFloorInflationYearOnYearMonthly cap = (CapFloorInflationYearOnYearMonthly) CAPS[0][availabelTenor.length - 1].getNthPayment(loopexp);
      expiryTimes[loopexp] = cap.getReferenceEndTime();
    }
    final InflationYearOnYearCapFloorParameters parameters = new InflationYearOnYearCapFloorParameters(expiryTimes, strikes, volatilities, PRICE_INDEX_EUR);
    final SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationObjective objective = new SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationObjective(parameters, CUR);
    final SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationEngine<InflationProviderInterface> calibrationEngine = new SuccessiveRootFinderInflationYearOnYearCapFloorCalibrationEngine<>(
        objective);
    for (int loop1 = 0; loop1 < strikes.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {
        for (int loop3 = 0; loop3 < CAPS[loop1][loop2].getNumberOfPayments(); loop3++) {
          marketPrices[loop1][loop2][loop3] = METHOD.presentValue(CAPS[loop1][loop2].getNthPayment(loop3), BLACK_INFLATION).getAmount(CUR);
        }
      }
    }

    for (int loop1 = 0; loop1 < strikes.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {
        for (int loop3 = 0; loop3 < CAPS[loop1][loop2].getNumberOfPayments(); loop3++) {
          calibrationEngine.addInstrument(CAPS[loop1][loop2].getNthPayment(loop3), marketPrices[loop1][loop2][loop3]);
        }
      }
    }
    calibrationEngine.calibrate(MARKET.getInflationProvider());
    final MultipleCurrencyAmount[][][] pvCapYearOnYear = new MultipleCurrencyAmount[STRIKES.length][availabelTenor.length][30];
    for (int loop1 = 0; loop1 < strikes.length; loop1++) {
      for (int loop2 = 0; loop2 < availabelTenor.length; loop2++) {
        for (int loop3 = 0; loop3 < CAPS[loop1][loop2].getNumberOfPayments(); loop3++) {
          final Interpolator2D interpolator = objective.getInflationCapYearOnYearProvider().getBlackParameters().getVolatilitySurface().getInterpolator();
          final BlackSmileCapInflationYearOnYearParameters CalibratedBlackSmileCapInflationYearOnYearParameters = new BlackSmileCapInflationYearOnYearParameters(
              objective.getInflationCapYearOnYearParameters(), interpolator);
          final BlackSmileCapInflationYearOnYearProvider CalibratedBlackSmileCapInflationYearOnYearProvider = new BlackSmileCapInflationYearOnYearProvider(objective
              .getInflationCapYearOnYearProvider().getInflationProvider(),
              CalibratedBlackSmileCapInflationYearOnYearParameters);
          pvCapYearOnYear[loop1][loop2][loop3] = METHOD.presentValue(CAPS[loop1][loop2].getNthPayment(loop3), CalibratedBlackSmileCapInflationYearOnYearProvider);
          assertEquals("Inflaiton year on year calibration: cap/floor " + loop1, pvCapYearOnYear[loop1][loop2][loop3].getAmount(CUR), marketPrices[loop1][loop2][loop3], 1E-2);
        }
View Full Code Here

TOP

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

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.