Examples of ParameterLimitsTransform


Examples of com.opengamma.analytics.math.minimization.ParameterLimitsTransform

  }

  @Test
      (enabled = false)
      public void debugTest2() {
    final ParameterLimitsTransform trans = new SingleRangeLimitTransform(0.0, LimitType.GREATER_THAN);
    ShiftedLogNormalTailExtrapolationFitter fitter = new ShiftedLogNormalTailExtrapolationFitter();
    double f = 1.0;
    double t = 2. / 52.;
    double k = 1.1;

    double mu = 0.133333;
    double theta = 0.16;
    double p = ShiftedLogNormalTailExtrapolation.price(f, k, t, true, mu, theta);
    double dd = ShiftedLogNormalTailExtrapolation.dualDelta(f, k, t, true, mu, theta);
    System.out.println("price and DD " + p + "\t" + dd);
    System.out.println("trans " + trans.inverseTransform(-2.2521684610628063));

    double[] res = fitter.fitPriceAndGrad(f, k, p, dd, t, true);
    assertEquals("mu ", mu, res[0], 1e-8);
    assertEquals("theta", theta, res[1], 1e-8);
  }
View Full Code Here

Examples of com.opengamma.analytics.math.minimization.ParameterLimitsTransform

    // We don't recover exactly the initial curves. Why?
    final LinkedHashMap<String, InterpolatedDoublesCurve> curves = CURVE_BUILDER.evaluate(res);
    for (final String name : NAMES) {
      final Curve<Double, Double> fitCurve = curves.get(name);
      final ParameterLimitsTransform trans = TRANSFORMS.get(name);
      final Curve<Double, Double> initialCurve = CURVES.get(name);
      for (int i = 0; i < 25; i++) {
        final double t = i * 20. / 25;
        assertEquals(name + " - time: " + t, initialCurve.getYValue(t), trans.inverseTransform(fitCurve.getYValue(t)), 5e-2);
      }

    }

    // diagnostics
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.