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

public Class PolynomialFitter

extends CurveFitter<PolynomialFunction.Parametric>
Class Inheritance
Annotations
@Deprecated
Imports
org.apache.commons.math3.analysis.polynomials.PolynomialFunction, org.apache.commons.math3.optimization.DifferentiableMultivariateVectorOptimizer

Deprecated

As of 3.1 (to be removed in 4.0).

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

Field Summary

Modifier and TypeField and Description
private final int
degree

Deprecated
Polynomial degree.

Constructor Summary

AccessConstructor and Description
public
PolynomialFitter(int
Maximal degree of the polynomial.
degree
,
final DifferentiableMultivariateVectorOptimizer
Optimizer to use for the fitting.
optimizer
)
Deprecated Since 3.1 (to be removed in 4.0).

Simple constructor.

public
PolynomialFitter(DifferentiableMultivariateVectorOptimizer
Optimizer to use for the fitting.
optimizer
)
Deprecated as a consequence of DifferentiableMultivariateVectorOptimizer 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
()
Deprecated Since 3.1 (to be removed in 4.0). Please use fit(double[]) instead.

Get the polynomial fitting the weighted (x, y) points.

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.optimization.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.optimization.fitting.CurveFitter:
addObservedPointaddObservedPointaddObservedPointclearObservationsfitgetObservations

Field Detail

degreeback to summary
private final int degree

Deprecated

Polynomial degree.

Annotations
@Deprecated

Constructor Detail

PolynomialFitterback to summary
public PolynomialFitter(int degree, final DifferentiableMultivariateVectorOptimizer optimizer)

Deprecated

Since 3.1 (to be removed in 4.0). Please use PolynomialFitter(DifferentiableMultivariateVectorOptimizer) instead.

Simple constructor.

The polynomial fitter built this way are complete polynomials, ie. a n-degree polynomial has n+1 coefficients.

Parameters
degree:int

Maximal degree of the polynomial.

optimizer:DifferentiableMultivariateVectorOptimizer

Optimizer to use for the fitting.

Annotations
@Deprecated
PolynomialFitterback to summary
public PolynomialFitter(DifferentiableMultivariateVectorOptimizer optimizer)

Deprecated

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

Simple constructor.

Parameters
optimizer:DifferentiableMultivariateVectorOptimizer

Optimizer to use for the fitting.

Since
3.1

Method Detail

fitback to summary
public double[] fit()

Deprecated

Since 3.1 (to be removed in 4.0). Please use fit(double[]) instead.

Get the polynomial fitting the weighted (x, y) points.

Returns:double[]

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

Annotations
@Deprecated
Exceptions
ConvergenceException:
if the algorithm failed to converge.
fitback to summary
public double[] fit(int maxEval, double[] guess)

Overrides org.apache.commons.math3.optimization.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.
Since
3.1
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.
Since
3.1