org.opensourcephysics.numerics
Class PolynomialLeastSquareFit

java.lang.Object
  extended by org.opensourcephysics.numerics.Polynomial
      extended by org.opensourcephysics.numerics.PolynomialLeastSquareFit
All Implemented Interfaces:
Function
Direct Known Subclasses:
KnownPolynomial

public class PolynomialLeastSquareFit
extends Polynomial

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
PolynomialLeastSquareFit(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
protected  void computeCoefficients()
          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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 Detail

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.