public class PolynomialFitter extends CurveFitter
Polynomial fitting is a very simple case of curve fitting. The estimated coefficients are the polynomial coefficients. They are searched by a least square estimator.
Constructor and Description |
---|
PolynomialFitter(int degree,
DifferentiableMultivariateVectorOptimizer optimizer)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
double[] |
fit()
Get the polynomial fitting the weighted (x, y) points.
|
addObservedPoint, addObservedPoint, addObservedPoint, clearObservations, fit, fit, getObservations
public PolynomialFitter(int degree, DifferentiableMultivariateVectorOptimizer optimizer)
The polynomial fitter built this way are complete polynomials, ie. a n-degree polynomial has n+1 coefficients.
degree
- Maximal degree of the polynomial.optimizer
- Optimizer to use for the fitting.public double[] fit()
ConvergenceException
- if the algorithm failed to converge.Copyright © 2003-2012 Apache Software Foundation. All Rights Reserved.