public abstract class AbstractCurveFitter extends Object
y = f(pi;x), where x is
the independent variable and the pi are the
parameters.
N observed points (xk, yk),
0 <= k < N.
∑yk - f(xk)2,
which is actually a least-squares problem.
This class contains boilerplate code for calling the
fit(Collection) method for obtaining the parameters.
The problem setup, such as the choice of optimization algorithm
for fitting a specific function is delegated to subclasses.| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractCurveFitter.TheoreticalValuesFunction
Vector function for computing function theoretical values.
|
| Constructor and Description |
|---|
AbstractCurveFitter() |
| Modifier and Type | Method and Description |
|---|---|
double[] |
fit(Collection<WeightedObservedPoint> points)
Fits a curve.
|
protected LeastSquaresOptimizer |
getOptimizer()
Creates an optimizer set up to fit the appropriate curve.
|
protected abstract LeastSquaresProblem |
getProblem(Collection<WeightedObservedPoint> points)
Creates a least squares problem corresponding to the appropriate curve.
|
public double[] fit(Collection<WeightedObservedPoint> points)
points - Observations.protected LeastSquaresOptimizer getOptimizer()
The default implementation uses a Levenberg-Marquardt optimizer.
points.protected abstract LeastSquaresProblem getProblem(Collection<WeightedObservedPoint> points)
points - Sample points.points.Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.