Class GaussianCurveFitter
- java.lang.Object
-
- org.apache.commons.math4.legacy.fitting.AbstractCurveFitter
-
- org.apache.commons.math4.legacy.fitting.SimpleCurveFitter
-
- org.apache.commons.math4.legacy.fitting.GaussianCurveFitter
-
public final class GaussianCurveFitter extends SimpleCurveFitter
Fits points to aGaussian
function.
Theinitial guess values
must be passed in the following order:- Normalization
- Mean
- Sigma
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());
- Since:
- 3.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GaussianCurveFitter.ParameterGuesser
Guesses the parametersnorm
,mean
, andsigma
of aGaussian.Parametric
based on the specified observed points.-
Nested classes/interfaces inherited from class org.apache.commons.math4.legacy.fitting.AbstractCurveFitter
AbstractCurveFitter.TheoreticalValuesFunction
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GaussianCurveFitter
create()
Creates a default curve fitter.-
Methods inherited from class org.apache.commons.math4.legacy.fitting.SimpleCurveFitter
create, create, getProblem, withMaxIterations, withStartPoint
-
Methods inherited from class org.apache.commons.math4.legacy.fitting.AbstractCurveFitter
fit, getOptimizer
-
-
-
-
Method Detail
-
create
public static GaussianCurveFitter create()
Creates a default curve fitter. The initial guess for the parameters will beGaussianCurveFitter.ParameterGuesser
computed automatically, and the maximum number of iterations of the optimization algorithm is set toInteger.MAX_VALUE
.- Returns:
- a curve fitter.
- See Also:
SimpleCurveFitter.withStartPoint(double[])
,SimpleCurveFitter.withMaxIterations(int)
-
-