/** * Configure the maximum number of iterations. * @param newMaxIter maximum number of iterations * @return a new instance. */ public GaussianCurveFitter withMaxIterations(int newMaxIter) { return new GaussianCurveFitter(initialGuess, newMaxIter); }
GaussianCurveFitter curveFitter = GaussianCurveFitter.create(); curveFitter = curveFitter.withStartPoint(guess); double[] coef = curveFitter.fit(pointList); Gaussian gaussian = new Gaussian(coef[0], coef[1], coef[2]); List list = new ArrayList();
/** * Creates a default curve fitter. * The initial guess for the parameters will be {@link ParameterGuesser} * computed automatically, and the maximum number of iterations of the * optimization algorithm is set to {@link Integer#MAX_VALUE}. * * @return a curve fitter. * * @see #withStartPoint(double[]) * @see #withMaxIterations(int) */ public static GaussianCurveFitter create() { return new GaussianCurveFitter(null, Integer.MAX_VALUE); }
/** * Configure the start point (initial guess). * @param newStart new start point (initial guess) * @return a new instance. */ public GaussianCurveFitter withStartPoint(double[] newStart) { return new GaussianCurveFitter(newStart.clone(), maxIter); }
/** * Configure the maximum number of iterations. * @param newMaxIter maximum number of iterations * @return a new instance. */ public GaussianCurveFitter withMaxIterations(int newMaxIter) { return new GaussianCurveFitter(initialGuess, newMaxIter); }
/** * Configure the maximum number of iterations. * @param newMaxIter maximum number of iterations * @return a new instance. */ public GaussianCurveFitter withMaxIterations(int newMaxIter) { return new GaussianCurveFitter(initialGuess, newMaxIter); }
/** * Creates a default curve fitter. * The initial guess for the parameters will be {@link ParameterGuesser} * computed automatically, and the maximum number of iterations of the * optimization algorithm is set to {@link Integer#MAX_VALUE}. * * @return a curve fitter. * * @see #withStartPoint(double[]) * @see #withMaxIterations(int) */ public static GaussianCurveFitter create() { return new GaussianCurveFitter(null, Integer.MAX_VALUE); }
/** * Creates a default curve fitter. * The initial guess for the parameters will be {@link ParameterGuesser} * computed automatically, and the maximum number of iterations of the * optimization algorithm is set to {@link Integer#MAX_VALUE}. * * @return a curve fitter. * * @see #withStartPoint(double[]) * @see #withMaxIterations(int) */ public static GaussianCurveFitter create() { return new GaussianCurveFitter(null, Integer.MAX_VALUE); }
/** * Configure the start point (initial guess). * @param newStart new start point (initial guess) * @return a new instance. */ public GaussianCurveFitter withStartPoint(double[] newStart) { return new GaussianCurveFitter(Cloner.clone(newStart), maxIter); }
/** * Configure the start point (initial guess). * @param newStart new start point (initial guess) * @return a new instance. */ public GaussianCurveFitter withStartPoint(double[] newStart) { return new GaussianCurveFitter(newStart.clone(), maxIter); }