Package com.opengamma.analytics.financial.interestrate

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


  @Test
  public void testPriceSABRSurface() {
    final YieldCurveBundle curves = TestsDataSetsSABR.createCurves1();
    final SABRInterestRateParameters sabrParameter = TestsDataSetsSABR.createSABR1();
    final SABRInterestRateDataBundle sabrBundle = new SABRInterestRateDataBundle(sabrParameter, curves);
    final PresentValueSABRCalculator pvcSabr = PresentValueSABRCalculator.getInstance();
    // Swaption pricing.
    final double priceLongPayer = SWAPTION_LONG_PAYER.accept(pvcSabr, sabrBundle);
    final double priceShortPayer = SWAPTION_SHORT_PAYER.accept(pvcSabr, sabrBundle);
    final double priceLongReceiver = SWAPTION_LONG_RECEIVER.accept(pvcSabr, sabrBundle);
    final double priceShortReceiver = SWAPTION_SHORT_RECEIVER.accept(pvcSabr, sabrBundle);
View Full Code Here


  public void presentValueMethodVsCalculator() {
    final YieldCurveBundle curves = TestsDataSetsSABR.createCurves1();
    final SABRInterestRateParameters sabrParameter = TestsDataSetsSABR.createSABR1();
    final SABRInterestRateDataBundle sabrBundle = new SABRInterestRateDataBundle(sabrParameter, curves);
    final double expectedPv = METHOD.presentValue(CAP_LONG, sabrBundle).getAmount();
    final PresentValueSABRCalculator pvc = PresentValueSABRCalculator.getInstance();
    final double pv = CAP_LONG.accept(pvc, sabrBundle);
    assertEquals("Cap/floor SABR pricing: method and calculator", expectedPv, pv, 1E-2);
  }
View Full Code Here

TOP

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

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.