@Test public void testPolyFitNormalize() throws Exception { final double[] x = MathUtils.increment(11, 0, 0.1); final double[] y = new double[x.length]; for (int i = 0; i < x.length; i++) { y[i] = erf(x[i]); } final double[] coeff_EXPECTED = {0.52048, 8.786103, -43.780634, -143.72893, 1652.73195}; final double[] coeff_ACTUAL = PolyUtils.polyFitNormalized(new DoubleMatrix(x), new DoubleMatrix(y), 4); Assert.assertArrayEquals(coeff_EXPECTED, coeff_ACTUAL, DELTA_01); }
public static double[] polyFitNormalized(DoubleMatrix t, DoubleMatrix y, final int degree) throws IllegalArgumentException { return polyFit(normalize(t), y, degree); }
PolyUtils { public static double[] polyFitNormalized(DoubleMatrix t, DoubleMatrix y, final int degree) throws IllegalArgumentException { return polyFit(normalize(t), y, degree); } }
PolyUtils { public static double[] polyFitNormalized(DoubleMatrix t, DoubleMatrix y, final int degree) throws IllegalArgumentException { return polyFit(normalize(t), y, degree); }  }
PolyUtils { public static double[] polyFitNormalized(DoubleMatrix t, DoubleMatrix y, final int degree) throws IllegalArgumentException { return polyFit(normalize(t), y, degree); }  static double normalize2(double data, final int min, final int max); static double normalize2(double data, final double min, final double max); static DoubleMatrix normalize(DoubleMatrix t); static int degreeFromCoefficients(int numOfCoefficients); static int numberOfCoefficients(final int degree); static double[] polyFitNormalized(DoubleMatrix t, DoubleMatrix y, final int degree); static double[] polyFit2D(final DoubleMatrix x, final DoubleMatrix y, final DoubleMatrix z, final int degree); static double[] polyFit(DoubleMatrix t, DoubleMatrix y, final int degree); static double polyVal1D(double x, double[] coeffs); static double[][] polyval(final double[] x, final double[] y, final double coeff[], int degree); static DoubleMatrix polyval(final DoubleMatrix x, final DoubleMatrix y, final DoubleMatrix coeff, int degree); static double polyval(final double x, final double y, final DoubleMatrix coeff, int degree); static double polyval(final double x, final double y, final double[] coeff); static double polyval(final double x, final double y, final double[] coeff, int degree); }
PolyUtils { public static double[] polyFitNormalized(DoubleMatrix t, DoubleMatrix y, final int degree) throws IllegalArgumentException { return polyFit(normalize(t), y, degree); }  static double normalize2(double data, final int min, final int max); static double normalize2(double data, final double min, final double max); static DoubleMatrix normalize(DoubleMatrix t); static int degreeFromCoefficients(int numOfCoefficients); static int numberOfCoefficients(final int degree); static double[] polyFitNormalized(DoubleMatrix t, DoubleMatrix y, final int degree); static double[] polyFit2D(final DoubleMatrix x, final DoubleMatrix y, final DoubleMatrix z, final int degree); static double[] polyFit(DoubleMatrix t, DoubleMatrix y, final int degree); static double polyVal1D(double x, double[] coeffs); static double[][] polyval(final double[] x, final double[] y, final double coeff[], int degree); static DoubleMatrix polyval(final DoubleMatrix x, final DoubleMatrix y, final DoubleMatrix coeff, int degree); static double polyval(final double x, final double y, final DoubleMatrix coeff, int degree); static double polyval(final double x, final double y, final double[] coeff); static double polyval(final double x, final double y, final double[] coeff, int degree);  }