public class PolynomialCurveFitter extends AbstractCurveFitter
polynomial
function.
initial guess
array defines the
degree of the polynomial to be fitted.
They must be sorted in increasing order of the polynomial's degree.
The optimal values of the coefficients will be returned in the same order.AbstractCurveFitter.TheoreticalValuesFunction
Modifier and Type | Method and Description |
---|---|
static PolynomialCurveFitter |
create(int degree)
Creates a default curve fitter.
|
protected LeastSquaresProblem |
getProblem(Collection<WeightedObservedPoint> observations)
Creates a least squares problem corresponding to the appropriate curve.
|
PolynomialCurveFitter |
withMaxIterations(int newMaxIter)
Configure the maximum number of iterations.
|
PolynomialCurveFitter |
withStartPoint(double[] newStart)
Configure the start point (initial guess).
|
fit, getOptimizer
public static PolynomialCurveFitter create(int degree)
Integer.MAX_VALUE
.degree
- Degree of the polynomial to be fitted.withStartPoint(double[])
,
withMaxIterations(int)
public PolynomialCurveFitter withStartPoint(double[] newStart)
newStart
- new start point (initial guess)public PolynomialCurveFitter withMaxIterations(int newMaxIter)
newMaxIter
- maximum number of iterationsprotected LeastSquaresProblem getProblem(Collection<WeightedObservedPoint> observations)
getProblem
in class AbstractCurveFitter
observations
- Sample points.points
.Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.