use of de.lmu.ifi.dbs.elki.math.linearalgebra.fitting.FittingFunction in project elki by elki-project.
the class KernelDensityFittingTest method run.
private double[] run(double[] data, double[] params) {
FittingFunction func = GaussianFittingFunction.STATIC;
boolean[] dofit = { true, true, true };
KernelDensityEstimator de = new KernelDensityEstimator(data, GaussianKernelDensityFunction.KERNEL, 1e-10);
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();
// "+fit.getChiSq()+" Iter: "+fit.maxruns);
return fit.getParams();
}
Aggregations