Class AccurateInterpolatingPolynomialEstimator

java.lang.Object
com.irurueta.numerical.interpolation.InterpolatingPolynomialEstimator
com.irurueta.numerical.interpolation.AccurateInterpolatingPolynomialEstimator

public class AccurateInterpolatingPolynomialEstimator extends InterpolatingPolynomialEstimator
Estimates coefficients of a polynomial passing through provided set of x and y points. This implementation is more accurate than other implementations such as implementations of PolynomialEstimator. Those implementations are based on curve fitting a polynomial of a given degree based on a number of points that can be much larger than the number of points, which results in a polynomial that does not exactly pass through provided points, but provides a minimum square error result. On the other hand, this implementation builds a polynomial of order equal to the length of provided x and y points. Ths implementation is more accurate than SimpleInterpolatingPolynomialEstimator, at the expense of greater computational cost (N^3 of this method vs N^2 of the simple one).
  • Constructor Details

    • AccurateInterpolatingPolynomialEstimator

      public AccurateInterpolatingPolynomialEstimator()
  • Method Details

    • estimate

      public void estimate(double[] xa, double[] ya, double[] cof) throws InterpolationException
      Estimates polynomial coefficients from provided x and y points.
      Specified by:
      estimate in class InterpolatingPolynomialEstimator
      Parameters:
      xa - x points the estimated polynomial passes through.
      ya - y points the estimated polynomial passes through.
      cof - instance where coefficients of estimated polynomial will be stored.
      Throws:
      IllegalArgumentException - if any of the provided values doesn't have the same length.
      InterpolationException - if interpolation fails for numerical reasons.