}
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());