public class GaussianCurveFitter extends AbstractCurveFitter
Gaussian
function.
initial guess values
must be passed
in the following order:
Usage example:
WeightedObservedPoints obs = new WeightedObservedPoints(); obs.add(4.0254623, 531026.0); obs.add(4.03128248, 984167.0); obs.add(4.03839603, 1887233.0); obs.add(4.04421621, 2687152.0); obs.add(4.05132976, 3461228.0); obs.add(4.05326982, 3580526.0); obs.add(4.05779662, 3439750.0); obs.add(4.0636168, 2877648.0); obs.add(4.06943698, 2175960.0); obs.add(4.07525716, 1447024.0); obs.add(4.08237071, 717104.0); obs.add(4.08366408, 620014.0); double[] parameters = GaussianCurveFitter.create().fit(obs.toList());
Modifier and Type | Class and Description |
---|---|
static class |
GaussianCurveFitter.ParameterGuesser
Guesses the parameters
norm , mean , and sigma
of a Gaussian.Parametric
based on the specified observed points. |
AbstractCurveFitter.TheoreticalValuesFunction
Modifier and Type | Method and Description |
---|---|
static GaussianCurveFitter |
create()
Creates a default curve fitter.
|
protected LeastSquaresProblem |
getProblem(Collection<WeightedObservedPoint> observations)
Creates a least squares problem corresponding to the appropriate curve.
|
GaussianCurveFitter |
withMaxIterations(int newMaxIter)
Configure the maximum number of iterations.
|
GaussianCurveFitter |
withStartPoint(double[] newStart)
Configure the start point (initial guess).
|
fit, getOptimizer
public static GaussianCurveFitter create()
GaussianCurveFitter.ParameterGuesser
computed automatically, and the maximum number of iterations of the
optimization algorithm is set to Integer.MAX_VALUE
.withStartPoint(double[])
,
withMaxIterations(int)
public GaussianCurveFitter withStartPoint(double[] newStart)
newStart
- new start point (initial guess)public GaussianCurveFitter withMaxIterations(int newMaxIter)
newMaxIter
- maximum number of iterationsprotected LeastSquaresProblem getProblem(Collection<WeightedObservedPoint> observations)
getProblem
in class AbstractCurveFitter
observations
- Sample points.points
.Copyright © 2016-2021 CS GROUP. All rights reserved.