Package com.opengamma.analytics.financial.interestrate.swaption.method

Examples of com.opengamma.analytics.financial.interestrate.swaption.method.SwaptionPhysicalHullWhiteSuccessiveRootFinderCalibrationEngine


    if (!(curves instanceof SABRInterestRateDataBundle)) {
      throw new UnsupportedOperationException("The PresentValueSABRHullWhiteMonteCarloCalculator visitor visitSwaptionPhysicalFixedIbor requires a SABRInterestRateDataBundle as data.");
    }
    final HullWhiteOneFactorPiecewiseConstantParameters hwParameters = new HullWhiteOneFactorPiecewiseConstantParameters(DEFAULT_MEAN_REVERSION, new double[] {0.01}, new double[0]);
    final SwaptionPhysicalHullWhiteCalibrationObjective objective = new SwaptionPhysicalHullWhiteCalibrationObjective(hwParameters);
    final SuccessiveRootFinderCalibrationEngine calibrationEngine = new SwaptionPhysicalHullWhiteSuccessiveRootFinderCalibrationEngine(objective);
    // Calibration instruments
    calibrationEngine.addInstrument(swaption, METHOD_SWAPTION_SABR);
    // Calibration
    calibrationEngine.calibrate(curves);
    final HullWhiteOneFactorPiecewiseConstantDataBundle hwBundle = new HullWhiteOneFactorPiecewiseConstantDataBundle(hwParameters, curves);
    // Pricing
    final HullWhiteMonteCarloMethod methodMC = new HullWhiteMonteCarloMethod(new NormalRandomNumberGenerator(0.0, 1.0, new MersenneTwister()), DEFAULT_NB_PATH);
    final CurrencyAmount pvMC = methodMC.presentValue(swaption, swaption.getCurrency(), swaption.getUnderlyingSwap().getFirstLeg().getDiscountCurve(), hwBundle);
    return pvMC.getAmount();
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.interestrate.swaption.method.SwaptionPhysicalHullWhiteSuccessiveRootFinderCalibrationEngine

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.