|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.optimization.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 polynomial coefficients. They are searched by a least square estimator.
Nested Class Summary | |
---|---|
private static class |
PolynomialFitter.ParametricPolynomial
Dedicated parametric polynomial class. |
Field Summary | |
---|---|
private int |
degree
Polynomial degree. |
private CurveFitter |
fitter
Fitter for the coefficients. |
Constructor Summary | |
---|---|
PolynomialFitter(int degree,
DifferentiableMultivariateVectorialOptimizer optimizer)
Simple constructor. |
Method Summary | |
---|---|
void |
addObservedPoint(double weight,
double x,
double y)
Add an observed weighted (x,y) point to the sample. |
PolynomialFunction |
fit()
Get the polynomial fitting the weighted (x, y) points. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final CurveFitter fitter
private final int degree
Constructor Detail |
---|
public PolynomialFitter(int degree, DifferentiableMultivariateVectorialOptimizer optimizer)
The polynomial fitter built this way are complete polynomials, ie. a n-degree polynomial has n+1 coefficients.
degree
- maximal degree of the polynomialoptimizer
- optimizer to use for the fittingMethod Detail |
---|
public void addObservedPoint(double weight, double x, double y)
weight
- weight of the observed point in the fitx
- abscissa of the pointy
- observed value of the point at x, after fitting we should
have P(x) as close as possible to this valuepublic PolynomialFunction fit() throws OptimizationException
OptimizationException
- if the algorithm failed to converge
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |