Top Description Constructors Methods
org.apache.commons.math3.fitting

public Class PolynomialFitter

extends CurveFitter<PolynomialFunction.Parametric>
Class Inheritance
Annotations
@Deprecated
Imports
org.apache.commons.math3.analysis.polynomials.PolynomialFunction, org.apache.commons.math3.optim.nonlinear.vector.MultivariateVectorOptimizer

Deprecated

As of 3.3. Please use PolynomialCurveFitter and WeightedObservedPoints instead.

Polynomial fitting is a very simple case of curve fitting. The estimated coefficients are the polynomial coefficients (see the fit method).
Since
2.0

Constructor Summary

AccessConstructor and Description
public
PolynomialFitter(MultivariateVectorOptimizer
Optimizer to use for the fitting.
optimizer
)
Deprecated as a consequence of MultivariateVectorOptimizer being deprecated.

Simple constructor.

Method Summary

Modifier and TypeMethod and Description
public double[]

Returns:

the coefficients of the polynomial that best fits the observed points.
fit
(int
Maximum number of evaluations of the polynomial.
maxEval
,
double[]
First guess for the coefficients. They must be sorted in increasing order of the polynomial's degree.
guess
)

Overrides org.apache.commons.math3.fitting.CurveFitter.fit.

Get the coefficients of the polynomial fitting the weighted data points.

public double[]

Returns:

the coefficients of the polynomial that best fits the observed points.
fit
(double[]
First guess for the coefficients. They must be sorted in increasing order of the polynomial's degree.
guess
)

Get the coefficients of the polynomial fitting the weighted data points.

Inherited from org.apache.commons.math3.fitting.CurveFitter:
addObservedPointaddObservedPointaddObservedPointclearObservationsfitgetObservations

Constructor Detail

PolynomialFitterback to summary
public PolynomialFitter(MultivariateVectorOptimizer optimizer)

Deprecated

as a consequence of MultivariateVectorOptimizer being deprecated. See corresponding docs for further information.

Simple constructor.

Parameters
optimizer:MultivariateVectorOptimizer

Optimizer to use for the fitting.

Method Detail

fitback to summary
public double[] fit(int maxEval, double[] guess)

Overrides org.apache.commons.math3.fitting.CurveFitter.fit.

Get the coefficients of the polynomial fitting the weighted data points. The degree of the fitting polynomial is guess.length - 1.

Parameters
maxEval:int

Maximum number of evaluations of the polynomial.

guess:double[]

First guess for the coefficients. They must be sorted in increasing order of the polynomial's degree.

Returns:double[]

the coefficients of the polynomial that best fits the observed points.

Exceptions
TooManyEvaluationsException:
if the number of evaluations exceeds maxEval.
ConvergenceException:
if the algorithm failed to converge.
fitback to summary
public double[] fit(double[] guess)

Get the coefficients of the polynomial fitting the weighted data points. The degree of the fitting polynomial is guess.length - 1.

Parameters
guess:double[]

First guess for the coefficients. They must be sorted in increasing order of the polynomial's degree.

Returns:double[]

the coefficients of the polynomial that best fits the observed points.

Exceptions
ConvergenceException:
if the algorithm failed to converge.