Class PolynomialLeastSquareFit

java.lang.Object
org.opensourcephysics.numerics.Polynomial
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.
  • 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.