Пример #1
0
 // @Test
 public void demoRnd1() {
   TsData s = rnd;
   TestFunction fn = new TestFunction(s);
   ISsqFunctionMinimizer min = new LevenbergMarquardtMethod();
   min.minimize(fn, new TestFunctionInstance(s));
   TestFunctionInstance rslt = (TestFunctionInstance) min.getResult();
   System.out.println("Rnd1");
   printRslt(rslt);
 }
Пример #2
0
  // @Test
  public void demo1() {
    TsData s = Data.X.log();
    TestFunction fn = new TestFunction(s);
    ISsqFunctionMinimizer min =
        new ec.tstoolkit.maths.realfunctions.levmar.LevenbergMarquardtMethod();
    //        ISsqFunctionMinimizer min = new
    // ec.tstoolkit.maths.realfunctions.minpack.LevenbergMarquardtMinimizer();
    //        min.setConvergenceCriterion(1e-9);
    min.setMaxIter(10);
    min.minimize(fn, new TestFunctionInstance(s));

    TestFunctionInstance rslt = (TestFunctionInstance) min.getResult();
    double[] gradient = fn.getDerivatives(rslt).getGradient();
    System.out.println("X");
    printRslt(rslt);
  }