Package de.lmu.ifi.dbs.elki.math.linearalgebra.fitting

Examples of de.lmu.ifi.dbs.elki.math.linearalgebra.fitting.LevenbergMarquardtMethod


    for(int i = 0; i < testx.length; i++) {
      s[i] = 1.0;
    }
    double[] params = { mean, stddevq, 1 };
    boolean[] dofit = { true, true, false };
    LevenbergMarquardtMethod fit = new LevenbergMarquardtMethod(new GaussianFittingFunction(), params, dofit, testx, testy, s);
    for(int i = 0; i < 50; i++) {
      fit.iterate();
    }
    double[] ps = fit.getParams();
    // compare results.
    double[] should = { 0.152986763079, 1.00115077, 1 };
    assertEquals("Mean doesn't match.", should[0], ps[0], 0.0001);
    assertEquals("Stddev doesn't match.", should[1], ps[1], 0.0001);
    assertEquals("Scaling doesn't match.", should[2], ps[2], 0.0001);
View Full Code Here


    for(int i = 0; i < testx.length; i++) {
      s[i] = 1.0;
    }
    double[] params = { mean, stddevq, 1 };
    boolean[] dofit = { true, true, false };
    LevenbergMarquardtMethod fit = new LevenbergMarquardtMethod(new GaussianFittingFunction(), params, dofit, testx, testy, s);
    for(int i = 0; i < 50; i++) {
      fit.iterate();
    }
    double[] ps = fit.getParams();
    // compare results.
    double[] should = { 0.1557811515, 1.006463733, 1 };
    assertEquals("Mean doesn't match.", should[0], ps[0], 0.0001);
    assertEquals("Stddev doesn't match.", should[1], ps[1], 0.0001);
    assertEquals("Scaling doesn't match.", should[2], ps[2], 0.0001);
View Full Code Here

  private double[] run(double[] data, double[] params) {
    FittingFunction func = new GaussianFittingFunction();
    boolean[] dofit = { true, true, true };
    KernelDensityEstimator de = new KernelDensityEstimator(data, GaussianKernelDensityFunction.KERNEL);
    LevenbergMarquardtMethod fit = new LevenbergMarquardtMethod(func, params, dofit, data, de.getDensity(), de.getVariance());
    // for(int i = 0; i < 100; i++) {
    // fit.iterate();
    // double[] ps = fit.getParams();
    // System.out.println("Mean: " + ps[0] + " Stddev: " + ps[1] + " Amp: " +
    // ps[2]+" Chi: "+fit.getChiSq());
    // }
    fit.run();
    // double[] ps = fit.getParams();
    // System.out.println("Result: "+ps[0]+" "+ps[1]+" "+ps[2]+" Chi: "+fit.getChiSq()+" Iter: "+fit.maxruns);
    return fit.getParams();
  }
View Full Code Here

    for(int i = 0; i < testx.length; i++) {
      s[i] = 1.0;
    }
    double[] params = { mean, stddevq, 1 };
    boolean[] dofit = { true, true, false };
    LevenbergMarquardtMethod fit = new LevenbergMarquardtMethod(new GaussianFittingFunction(), params, dofit, testx, testy, s);
    for(int i = 0; i < 50; i++) {
      fit.iterate();
    }
    double[] ps = fit.getParams();
    // compare results.
    double[] should = { 0.152986763079, 1.00115077, 1 };
    assertEquals("Mean doesn't match.", should[0], ps[0], 0.0001);
    assertEquals("Stddev doesn't match.", should[1], ps[1], 0.0001);
    assertEquals("Scaling doesn't match.", should[2], ps[2], 0.0001);
View Full Code Here

    for(int i = 0; i < testx.length; i++) {
      s[i] = 1.0;
    }
    double[] params = { mean, stddevq, 1 };
    boolean[] dofit = { true, true, false };
    LevenbergMarquardtMethod fit = new LevenbergMarquardtMethod(new GaussianFittingFunction(), params, dofit, testx, testy, s);
    for(int i = 0; i < 50; i++) {
      fit.iterate();
    }
    double[] ps = fit.getParams();
    // compare results.
    double[] should = { 0.1557811515, 1.006463733, 1 };
    assertEquals("Mean doesn't match.", should[0], ps[0], 0.0001);
    assertEquals("Stddev doesn't match.", should[1], ps[1], 0.0001);
    assertEquals("Scaling doesn't match.", should[2], ps[2], 0.0001);
View Full Code Here

  private double[] run(double[] data, double[] params) {
    FittingFunction func = new GaussianFittingFunction();
    boolean[] dofit = { true, true, true };
    KernelDensityEstimator de = new KernelDensityEstimator(data, GaussianKernelDensityFunction.KERNEL);
    LevenbergMarquardtMethod fit = new LevenbergMarquardtMethod(func, params, dofit, data, de.getDensity(), de.getVariance());
    // for(int i = 0; i < 100; i++) {
    // fit.iterate();
    // double[] ps = fit.getParams();
    // System.out.println("Mean: " + ps[0] + " Stddev: " + ps[1] + " Amp: " +
    // ps[2]+" Chi: "+fit.getChiSq());
    // }
    fit.run();
    // double[] ps = fit.getParams();
    // System.out.println("Result: "+ps[0]+" "+ps[1]+" "+ps[2]+" Chi: "+fit.getChiSq()+" Iter: "+fit.maxruns);
    return fit.getParams();
  }
View Full Code Here

TOP

Related Classes of de.lmu.ifi.dbs.elki.math.linearalgebra.fitting.LevenbergMarquardtMethod

Copyright © 2018 www.massapicom. 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.