@Test public void test() { System.out.println("LevenbergMarquardt"); MathEx.setSeed(19650218); double[] x = new double[100]; double[] y = new double[100]; GaussianDistribution d = new GaussianDistribution(0.0, 1); for (int i = 0; i < x.length; i++) { x[i] = (i+1) * 0.05; y[i] = 1.0 / (1 + 1.2 * Math.pow(x[i], 1.8)) + d.rand() * 0.03; } double[] p = {0.5, 0.0}; LevenbergMarquardt lma = LevenbergMarquardt.fit(func, x, y, p); assertEquals(0.0863, lma.sse, 1E-4); assertEquals(1.2260, lma.parameters[0], 1E-4); assertEquals(1.8024, lma.parameters[1], 1E-4); }
public static LevenbergMarquardt fit(DifferentiableMultivariateFunction func, double[] x, double[] y, double[] p) { return fit(func, x, y, p, 0.0001, 20); }
LevenbergMarquardt { public static LevenbergMarquardt fit(DifferentiableMultivariateFunction func, double[] x, double[] y, double[] p) { return fit(func, x, y, p, 0.0001, 20); } }
LevenbergMarquardt { public static LevenbergMarquardt fit(DifferentiableMultivariateFunction func, double[] x, double[] y, double[] p) { return fit(func, x, y, p, 0.0001, 20); } LevenbergMarquardt(double[] parameters, double[] fittedValues, double[] residuals, double sse); }
LevenbergMarquardt { public static LevenbergMarquardt fit(DifferentiableMultivariateFunction func, double[] x, double[] y, double[] p) { return fit(func, x, y, p, 0.0001, 20); } LevenbergMarquardt(double[] parameters, double[] fittedValues, double[] residuals, double sse); static LevenbergMarquardt fit(DifferentiableMultivariateFunction func, double[] x, double[] y, double[] p); static LevenbergMarquardt fit(DifferentiableMultivariateFunction func, double[] x, double[] y, double[] p, double stol, int maxIter); static LevenbergMarquardt fit(DifferentiableMultivariateFunction func, double[][] x, double[] y, double[] p); static LevenbergMarquardt fit(DifferentiableMultivariateFunction func, double[][] x, double[] y, double[] p, double stol, int maxIter); }
LevenbergMarquardt { public static LevenbergMarquardt fit(DifferentiableMultivariateFunction func, double[] x, double[] y, double[] p) { return fit(func, x, y, p, 0.0001, 20); } LevenbergMarquardt(double[] parameters, double[] fittedValues, double[] residuals, double sse); static LevenbergMarquardt fit(DifferentiableMultivariateFunction func, double[] x, double[] y, double[] p); static LevenbergMarquardt fit(DifferentiableMultivariateFunction func, double[] x, double[] y, double[] p, double stol, int maxIter); static LevenbergMarquardt fit(DifferentiableMultivariateFunction func, double[][] x, double[] y, double[] p); static LevenbergMarquardt fit(DifferentiableMultivariateFunction func, double[][] x, double[] y, double[] p, double stol, int maxIter); final double[] parameters; final double[] fittedValues; final double[] residuals; final double sse; }