Class PolynomialFitter
- java.lang.Object
-
- org.apache.commons.math3.optimization.fitting.CurveFitter<PolynomialFunction.Parametric>
-
- org.apache.commons.math3.optimization.fitting.PolynomialFitter
-
@Deprecated public class PolynomialFitter extends CurveFitter<PolynomialFunction.Parametric>
Deprecated.As of 3.1 (to be removed in 4.0).Polynomial fitting is a very simple case ofcurve fitting
. The estimated coefficients are the polynomial coefficients (see thefit
method).- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description private int
degree
Deprecated.
-
Constructor Summary
Constructors Constructor Description PolynomialFitter(int degree, DifferentiableMultivariateVectorOptimizer optimizer)
Deprecated.Since 3.1 (to be removed in 4.0).PolynomialFitter(DifferentiableMultivariateVectorOptimizer optimizer)
Deprecated.Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description double[]
fit()
Deprecated.Since 3.1 (to be removed in 4.0).double[]
fit(double[] guess)
Deprecated.Get the coefficients of the polynomial fitting the weighted data points.double[]
fit(int maxEval, double[] guess)
Deprecated.Get the coefficients of the polynomial fitting the weighted data points.-
Methods inherited from class org.apache.commons.math3.optimization.fitting.CurveFitter
addObservedPoint, addObservedPoint, addObservedPoint, clearObservations, fit, fit, getObservations
-
-
-
-
Constructor Detail
-
PolynomialFitter
@Deprecated public PolynomialFitter(int degree, DifferentiableMultivariateVectorOptimizer optimizer)
Deprecated.Since 3.1 (to be removed in 4.0). Please usePolynomialFitter(DifferentiableMultivariateVectorOptimizer)
instead.Simple constructor.The polynomial fitter built this way are complete polynomials, ie. a n-degree polynomial has n+1 coefficients.
- Parameters:
degree
- Maximal degree of the polynomial.optimizer
- Optimizer to use for the fitting.
-
PolynomialFitter
public PolynomialFitter(DifferentiableMultivariateVectorOptimizer optimizer)
Deprecated.Simple constructor.- Parameters:
optimizer
- Optimizer to use for the fitting.- Since:
- 3.1
-
-
Method Detail
-
fit
@Deprecated public double[] fit()
Deprecated.Since 3.1 (to be removed in 4.0). Please usefit(double[])
instead.Get the polynomial fitting the weighted (x, y) points.- Returns:
- the coefficients of the polynomial that best fits the observed points.
- Throws:
ConvergenceException
- if the algorithm failed to converge.
-
fit
public double[] fit(int maxEval, double[] guess)
Deprecated.Get the coefficients of the polynomial fitting the weighted data points. The degree of the fitting polynomial isguess.length - 1
.- Parameters:
guess
- First guess for the coefficients. They must be sorted in increasing order of the polynomial's degree.maxEval
- Maximum number of evaluations of the polynomial.- Returns:
- the coefficients of the polynomial that best fits the observed points.
- Throws:
TooManyEvaluationsException
- if the number of evaluations exceedsmaxEval
.ConvergenceException
- if the algorithm failed to converge.- Since:
- 3.1
-
fit
public double[] fit(double[] guess)
Deprecated.Get the coefficients of the polynomial fitting the weighted data points. The degree of the fitting polynomial isguess.length - 1
.- Parameters:
guess
- First guess for the coefficients. They must be sorted in increasing order of the polynomial's degree.- Returns:
- the coefficients of the polynomial that best fits the observed points.
- Throws:
ConvergenceException
- if the algorithm failed to converge.- Since:
- 3.1
-
-