Package org.opensourcephysics.numerics
Class PolynomialLeastSquareFit
java.lang.Object
org.opensourcephysics.numerics.Polynomial
org.opensourcephysics.numerics.PolynomialLeastSquareFit
- All Implemented Interfaces:
Function
- Direct Known Subclasses:
KnownPolynomial
Polynomial least square fit without any error estimation.
See Object Oriented Implementation of Numerical Methods by Didier H. Besset for fitting with error estimation.
- Author:
- Wolfgang Christian.
-
Field Summary
Fields inherited from class org.opensourcephysics.numerics.Polynomial
coefficients
-
Constructor Summary
ConstructorsConstructorDescriptionPolynomialLeastSquareFit
(double[] coeffs) Constructs a PolynomialLeastSquareFit with the given coefficients.PolynomialLeastSquareFit
(double[] xd, double[] yd, int degree) Constructs a PolynomialLeastSquareFit with the given order. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Computes the polynomial coefficients.void
fitData
(double[] xd, double[] yd) Sets the data and updates the fit coefficients.Methods inherited from class org.opensourcephysics.numerics.Polynomial
add, add, coefficient, deflate, degree, derivative, divide, divide, divideWithRemainder, evalPolynomial, evaluate, getCoefficients, integral, integral, multiply, multiply, roots, rootsReal, subtract, subtract, toString, valueAndDerivative
-
Constructor Details
-
PolynomialLeastSquareFit
public PolynomialLeastSquareFit(double[] xd, double[] yd, int degree) Constructs a PolynomialLeastSquareFit with the given order.- Parameters:
xd
- double[]yd
- double[]degree
- int the degree of the polynomial
-
PolynomialLeastSquareFit
public PolynomialLeastSquareFit(double[] coeffs) Constructs a PolynomialLeastSquareFit with the given coefficients. Added by D Brown 12/20/2005.- Parameters:
coeffs
- the coefficients
-
-
Method Details
-
fitData
public void fitData(double[] xd, double[] yd) Sets the data and updates the fit coefficients. Added by D Brown 12/1/05.- Parameters:
xd
- double[]yd
- double[]
-
computeCoefficients
protected void computeCoefficients()Computes the polynomial coefficients.
-