public class SimpleCurveFitter extends AbstractCurveFitter
function
.AbstractCurveFitter.TheoreticalValuesFunction
Modifier and Type | Field and Description |
---|---|
private ParametricUnivariateFunction |
function
Function to fit.
|
private double[] |
initialGuess
Initial guess for the parameters.
|
private int |
maxIter
Maximum number of iterations of the optimization algorithm.
|
Modifier | Constructor and Description |
---|---|
private |
SimpleCurveFitter(ParametricUnivariateFunction function,
double[] initialGuess,
int maxIter)
Contructor used by the factory methods.
|
Modifier and Type | Method and Description |
---|---|
static SimpleCurveFitter |
create(ParametricUnivariateFunction f,
double[] start)
Creates a curve fitter.
|
protected LeastSquaresProblem |
getProblem(java.util.Collection<WeightedObservedPoint> observations)
Creates a least squares problem corresponding to the appropriate curve.
|
SimpleCurveFitter |
withMaxIterations(int newMaxIter)
Configure the maximum number of iterations.
|
SimpleCurveFitter |
withStartPoint(double[] newStart)
Configure the start point (initial guess).
|
fit, getOptimizer
private final ParametricUnivariateFunction function
private final double[] initialGuess
private final int maxIter
private SimpleCurveFitter(ParametricUnivariateFunction function, double[] initialGuess, int maxIter)
function
- Function to fit.initialGuess
- Initial guess. Cannot be null
. Its length must
be consistent with the number of parameters of the function
to fit.maxIter
- Maximum number of iterations of the optimization algorithm.public static SimpleCurveFitter create(ParametricUnivariateFunction f, double[] start)
Integer.MAX_VALUE
.f
- Function to fit.start
- Initial guess for the parameters. Cannot be null
.
Its length must be consistent with the number of parameters of the
function to fit.withStartPoint(double[])
,
withMaxIterations(int)
public SimpleCurveFitter withStartPoint(double[] newStart)
newStart
- new start point (initial guess)public SimpleCurveFitter withMaxIterations(int newMaxIter)
newMaxIter
- maximum number of iterationsprotected LeastSquaresProblem getProblem(java.util.Collection<WeightedObservedPoint> observations)
getProblem
in class AbstractCurveFitter
observations
- Sample points.points
.