Package com.opengamma.analytics.financial.interestrate

Examples of com.opengamma.analytics.financial.interestrate.PresentValueSABRHullWhiteMonteCarloCalculator


   * Tests the pricing with calibration to SABR cap/floor prices.
   */
  public void presentValueFixedWithCalibration() {
    final SABRInterestRateParameters sabrParameter = TestsDataSetsSABR.createSABR1();
    final SABRInterestRateDataBundle sabrBundle = new SABRInterestRateDataBundle(sabrParameter, CURVES);
    final PresentValueSABRHullWhiteMonteCarloCalculator calculatorMC = PresentValueSABRHullWhiteMonteCarloCalculator.getInstance();
    final double pvMC = ANNUITY_RATCHET_FIXED.accept(calculatorMC, sabrBundle);
    final double pvMCPreviousRun = 8400036.210; //50000 paths: 8400036.210 - 12500 paths: 8402639.933;
    assertEquals("Annuity Ratchet Ibor - Hull-White - Monte Carlo", pvMCPreviousRun, pvMC, 1.0E-2);
  }
View Full Code Here


  /**
   * Tests the present value of the Hull-White Monte-Carlo calibrated to SABR swaption.
   */
  public void presentValueSABRHullWhiteMonteCarlo() {
    final CurrencyAmount pvSABR = METHOD.presentValue(SWAPTION_LONG_PAYER, SABR_BUNDLE);
    final PresentValueSABRHullWhiteMonteCarloCalculator pvcSABRHWMC = PresentValueSABRHullWhiteMonteCarloCalculator.getInstance();
    final double pvMC = SWAPTION_LONG_PAYER.accept(pvcSABRHWMC, SABR_BUNDLE);
    assertEquals("Swaption Physical SABR: Present value using Hull-White by Monte Carlo", pvSABR.getAmount(), pvMC, 2.5E+4);
  }
View Full Code Here

    endTime = System.currentTimeMillis();
    System.out.println(nbTest + " physical swaptions SABR (price+delta+vega): " + (endTime - startTime) + " ms");
    // Performance note: price+delta+vega: 12-Jun-12: On Mac Pro 3.2 GHz Quad-Core Intel Xeon: 110 ms for 1000 swaptions.

    final int nbTest2 = 10;
    final PresentValueSABRHullWhiteMonteCarloCalculator pvcSABRHWMC = PresentValueSABRHullWhiteMonteCarloCalculator.getInstance();
    final double[] pvMC = new double[nbTest2];

    startTime = System.currentTimeMillis();
    for (int looptest = 0; looptest < nbTest2; looptest++) {
      pvMC[looptest] = SWAPTION_LONG_PAYER.accept(pvcSABRHWMC, SABR_BUNDLE);
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.interestrate.PresentValueSABRHullWhiteMonteCarloCalculator

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.