

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object org.jscience.mathematics.analysis.fitting.AbstractCurveFitter org.jscience.mathematics.analysis.fitting.PolynomialFitter
public class PolynomialFitter
This class implements a curve fitting specialized for polynomials.
Polynomial fitting is a very simple case of curve fitting. The estimated coefficients are the polynom coefficients. They are searched by a least square estimator.
This class
PolynomialCoefficient
,
Serialized FormNested Class Summary 

Nested classes/interfaces inherited from class org.jscience.mathematics.analysis.fitting.AbstractCurveFitter 

AbstractCurveFitter.FitMeasurement 
Field Summary 

Fields inherited from class org.jscience.mathematics.analysis.fitting.AbstractCurveFitter 

coefficients, measurements 
Constructor Summary  

PolynomialFitter(int degree,
int maxIterations,
double convergence,
double steadyStateThreshold,
double epsilon)
Simple constructor. 

PolynomialFitter(PolynomialCoefficient[] coefficients,
int maxIterations,
double convergence,
double steadyStateThreshold,
double epsilon)
Simple constructor. 
Method Summary  

double 
partial(double x,
EstimatedParameter p)
Get the derivative of the function at x with respect to parameter p. 
double 
valueAt(double x)
Get the value of the function at x according to the current parameters value. 
Methods inherited from class org.jscience.mathematics.analysis.fitting.AbstractCurveFitter 

addWeightedPair, fit, getAllParameters, getMeasurements, getUnboundParameters, sortMeasurements 
Methods inherited from class java.lang.Object 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Methods inherited from interface org.jscience.mathematics.analysis.estimation.EstimationProblem 

getAllParameters, getMeasurements, getUnboundParameters 
Constructor Detail 

public PolynomialFitter(int degree, int maxIterations, double convergence, double steadyStateThreshold, double epsilon)
The polynomial fitter built this way are complete polynoms,
ie. a ndegree polynom has n+1 coefficients. In order to build
fitter for sparse polynoms (for example a x^20  b
x^30
, on should first build the coefficients array and
provide it to PolynomialFitter(PolynomialCoefficient[],int,double,double,
double)
.
degree
 maximal degree of the polynommaxIterations
 maximum number of iterations allowedconvergence
 criterion threshold below which we do not need
to improve the criterion anymoresteadyStateThreshold
 steady state detection threshold, the
problem has reached a steady state (read converged) if
Math.abs (Jn  Jn1) < Jn * convergence
, where
Jn
and Jn1
are the current and
preceding criterion value (square sum of the weighted residuals
of considered measurements).epsilon
 threshold under which the matrix of the linearized
problem is considered singular (see SquareMatrix.solve
).public PolynomialFitter(PolynomialCoefficient[] coefficients, int maxIterations, double convergence, double steadyStateThreshold, double epsilon)
This constructor can be used either when a first estimate of
the coefficients is already known (which is of little interest
because the fit cost is the same whether a first guess is known or
not) or when one needs to handle sparse polynoms like a
x^20  b x^30
.
coefficients
 first estimate of the coefficients.
A reference to this array is hold by the newly created
object. Its elements will be adjusted during the fitting process
and they will be set to the adjusted coefficients at the end.maxIterations
 maximum number of iterations allowedconvergence
 criterion threshold below which we do not need
to improve the criterion anymoresteadyStateThreshold
 steady state detection threshold, the
problem has reached a steady state (read converged) if
Math.abs (Jn  Jn1) < Jn * convergence
, where
Jn
and Jn1
are the current and
preceding criterion value (square sum of the weighted residuals
of considered measurements).epsilon
 threshold under which the matrix of the linearized
problem is considered singular (see SquareMatrix.solve
).Method Detail 

public double valueAt(double x)
valueAt
in class AbstractCurveFitter
x
 abscissa at which the theoretical value is requested
public double partial(double x, EstimatedParameter p)
partial
in class AbstractCurveFitter
x
 abscissa at which the partial derivative is requestedp
 parameter with respect to which the derivative is requested


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 