Package org.apache.commons.math.estimation

Examples of org.apache.commons.math.estimation.LevenbergMarquardtEstimator.estimate()


    estimator.setCostRelativeTolerance(Math.sqrt(2.22044604926e-16));
    estimator.setParRelativeTolerance(Math.sqrt(2.22044604926e-16));
    estimator.setOrthoTolerance(2.22044604926e-16);
    assertTrue(function.checkTheoreticalStartCost(estimator.getRMS(function)));
    try {
      estimator.estimate(function);
      assertFalse(exceptionExpected);
    } catch (EstimationException lsse) {
      assertTrue(exceptionExpected);
    }
    assertTrue(function.checkTheoreticalMinCost(estimator.getRMS(function)));
View Full Code Here


            for (int i = 0; i < angles.length; ++i) {
                problem.addAngularMeasurement(3.0e7, angles[i][0], angles[i][1]);
            };

            LevenbergMarquardtEstimator estimator = new LevenbergMarquardtEstimator();
            estimator.estimate(problem);
            System.out.println("initial position: " + problem.getX0() + " " + problem.getY0());
            System.out.println("velocity: " + problem.getVx0() + " " + problem.getVy0());

        } catch (EstimationException ee) {
          System.err.println(ee.getMessage());
View Full Code Here

    estimator.setCostRelativeTolerance(FastMath.sqrt(2.22044604926e-16));
    estimator.setParRelativeTolerance(FastMath.sqrt(2.22044604926e-16));
    estimator.setOrthoTolerance(2.22044604926e-16);
    assertTrue(function.checkTheoreticalStartCost(estimator.getRMS(function)));
    try {
      estimator.estimate(function);
      assertFalse(exceptionExpected);
    } catch (EstimationException lsse) {
      assertTrue(exceptionExpected);
    }
    assertTrue(function.checkTheoreticalMinCost(estimator.getRMS(function)));
View Full Code Here

    estimator.setCostRelativeTolerance(Math.sqrt(2.22044604926e-16));
    estimator.setParRelativeTolerance(Math.sqrt(2.22044604926e-16));
    estimator.setOrthoTolerance(2.22044604926e-16);
    assertTrue(function.checkTheoreticalStartCost(estimator.getRMS(function)));
    try {
      estimator.estimate(function);
      assertFalse(exceptionExpected);
    } catch (EstimationException lsse) {
      assertTrue(exceptionExpected);
    }
    assertTrue(function.checkTheoreticalMinCost(estimator.getRMS(function)));
View Full Code Here

    estimator.setCostRelativeTolerance(Math.sqrt(2.22044604926e-16));
    estimator.setParRelativeTolerance(Math.sqrt(2.22044604926e-16));
    estimator.setOrthoTolerance(2.22044604926e-16);
    assertTrue(function.checkTheoreticalStartCost(estimator.getRMS(function)));
    try {
      estimator.estimate(function);
      assertFalse(exceptionExpected);
    } catch (EstimationException lsse) {
      assertTrue(exceptionExpected);
    }
    assertTrue(function.checkTheoreticalMinCost(estimator.getRMS(function)));
View Full Code Here

      circle.addPoint( 50.0,  -6.0);
      circle.addPoint(110.0, -20.0);
      circle.addPoint( 35.015.0);
      circle.addPoint( 45.097.0);
      LevenbergMarquardtEstimator estimator = new LevenbergMarquardtEstimator();
      estimator.estimate(circle);
      assertTrue(estimator.getCostEvaluations() < 10);
      assertTrue(estimator.getJacobianEvaluations() < 10);
      double rms = estimator.getRMS(circle);
      assertEquals(1.768262623567235,  Math.sqrt(circle.getM()) * rms,  1.0e-10);
      assertEquals(69.96016176931406, circle.getRadius(), 1.0e-10);
View Full Code Here

      double  r = circle.getRadius();
      for (double d= 0; d < 2 * Math.PI; d += 0.01) {
          circle.addPoint(cx + r * Math.cos(d), cy + r * Math.sin(d));
      }
      estimator = new LevenbergMarquardtEstimator();
      estimator.estimate(circle);
      cov = estimator.getCovariances(circle);
      assertEquals(0.004, cov[0][0], 0.001);
      assertEquals(6.40e-7, cov[0][1], 1.0e-9);
      assertEquals(cov[0][1], cov[1][0], 1.0e-14);
      assertEquals(0.003, cov[1][1], 0.001);
View Full Code Here

    };
    for (int i = 0; i < points.length; ++i) {
      circle.addPoint(points[i][0], points[i][1]);
    }
    LevenbergMarquardtEstimator estimator = new LevenbergMarquardtEstimator();
    estimator.estimate(circle);
    assertTrue(estimator.getCostEvaluations() < 15);
    assertTrue(estimator.getJacobianEvaluations() < 10);
    assertEquals( 0.030184491196225207, estimator.getRMS(circle), 1.0e-9);
    assertEquals( 0.2922350065939634,   circle.getRadius(), 1.0e-9);
    assertEquals(-0.15173845023862165,  circle.getX(),      1.0e-8);
View Full Code Here

                              new EstimatedParameter[] {
                                 new EstimatedParameter("p0", 0)
                              }, 3.0)
      });
    LevenbergMarquardtEstimator estimator = new LevenbergMarquardtEstimator();
    estimator.estimate(problem);
    assertEquals(0, estimator.getRMS(problem), 1.0e-10);
    try {
        estimator.guessParametersErrors(problem);
        fail("an exception should have been thrown");
    } catch (EstimationException ee) {
View Full Code Here

                            new EstimatedParameter[] { x[0], x[1] },
                            1.0)
    });

    LevenbergMarquardtEstimator estimator = new LevenbergMarquardtEstimator();
    estimator.estimate(problem);
    assertEquals(0, estimator.getRMS(problem), 1.0e-10);
    assertEquals(7.0, x[0].getEstimate(), 1.0e-10);
    assertEquals(3.0, x[1].getEstimate(), 1.0e-10);

  }
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.