Package com.opengamma.analytics.math.function

Examples of com.opengamma.analytics.math.function.DoubleFunction1D.evaluate()


    double[] yValues = new double[nPts];

    for (int i = 0; i < nPts; ++i) {
      xValues[i] = -5. + 10 * i / (nPts - 1);
      //xValues[i] = 3. * (randObj.nextDouble() + .5);
      yValues[i] = func.evaluate(xValues[i]);
    }

    PolynomialsLeastSquaresFitterResult result = regObj.regressVerbose(xValues, yValues, degree, false);

    final double[] coeffResult = result.getCoeff();
View Full Code Here


    for (int i = 0; i < nPts; ++i) {
      //  xValues[i] = -5. + 10 * i / (nPts - 1);
      //xValues[i] = 3. * (randObj.nextDouble() + .5);
      xValuesNom[i] = xValues[i] / std - mean / std;
      yValues[i] = func.evaluate(xValuesNom[i]);
    }

    PolynomialsLeastSquaresFitterResult resultNom = regObj.regressVerbose(xValues, yValues, degree, true);
    PolynomialsLeastSquaresFitterResult result = regObj.regressVerbose(xValuesNom, yValues, degree, false);

View Full Code Here

    final DoubleFunction1D func = new RealPolynomialFunction1D(coeffResult);

    for (int i = 0; i < 100; ++i) {
      final double k = -5. + 10. * i / 100.;
      System.out.println(k + "\t" + func.evaluate(k));
    }

    System.out.println("\n");
    final double[] resResult = result.getResiduals();
    double resSumSqHalf = 0.;
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.