Examples of SABRDataBundle


Examples of com.opengamma.analytics.financial.model.option.definition.SABRDataBundle

  private static final double EPS = 1e-4;
  private static final DoublesPair PAIR = new DoublesPair(0., 0.);

  @Test
  public void testBetaApproachesOne() {
    final SABRDataBundle data = DATA.withBeta(1 - 1e-12);
    assertEquals(MODEL.getSurface(OPTION, DATA).getVolatility(PAIR), MODEL.getSurface(OPTION, data).getVolatility(PAIR), 1e-9);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.model.option.definition.SABRDataBundle

    assertEquals(MODEL.getSurface(OPTION, DATA).getVolatility(PAIR), MODEL.getSurface(OPTION, data).getVolatility(PAIR), 1e-9);
  }

  @Test
  public void testBetaApproachesZero() {
    final SABRDataBundle data = DATA.withBeta(1e-12);
    assertEquals(MODEL.getSurface(OPTION, DATA.withBeta(1e-12)).getVolatility(PAIR), MODEL.getSurface(OPTION, data).getVolatility(PAIR), 1e-9);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.model.option.definition.SABRDataBundle

    assertEquals(MODEL.getSurface(OPTION, DATA.withBeta(1e-12)).getVolatility(PAIR), MODEL.getSurface(OPTION, data).getVolatility(PAIR), 1e-9);
  }

  @Test
  public void testWithZeroVolOfVol() {
    final SABRDataBundle data = DATA.withVolOfVol(0);
    assertEquals(MODEL.getSurface(OPTION, data).getVolatility(PAIR), ATM_VOL.getVolatility(PAIR));
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.model.option.definition.SABRDataBundle

   * Number from Option Pricing Formulas, p270
   */
  @Test
  public void test() {
    assertEquals(MODEL.getSurface(OPTION, DATA).getVolatility(PAIR), 0.3454, EPS);
    SABRDataBundle data1 = DATA.withRho(-0.75).withBeta(0.999);
    SABRDataBundle data2 = DATA.withRho(0).withBeta(0.999);
    SABRDataBundle data3 = DATA.withRho(0.5).withBeta(0.999);
    OptionDefinition option = new EuropeanVanillaOptionDefinition(70, EXPIRY, false);
    data1 = CALIBRATION.calibrate(option, data1);
    data2 = CALIBRATION.calibrate(option, data2);
    data3 = CALIBRATION.calibrate(option, data3);
    assertEquals(MODEL.getSurface(option, data1).getVolatility(PAIR), 0.3668, EPS);
View Full Code Here

Examples of com.opengamma.analytics.financial.model.option.definition.SABRDataBundle

  }

  @Test
  public void testZeroVolOfVol() {
    final double beta = 0.5;
    final SABRDataBundle data = DATA.withVolOfVol(0).withBeta(beta);
    final double f1 = Math.pow(F, 1 - beta);
    final double a0 = -ATM_SIGMA * f1;
    final double a1 = 1;
    final double a2 = 0;
    final double a3 = (1 - beta) * (1 - beta) * T / 24 / f1 / f1;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.