Class SingleDimensionLinearFitter

Direct Known Subclasses:
SimpleSingleDimensionLinearFitter, SvdSingleDimensionLinearFitter

public abstract class SingleDimensionLinearFitter extends SingleDimensionFitter
Base class to fit provided data (x,y) to a function made of a linear combination of functions used as a basis (i.e. f(x) = a * f0(x) + b * f1(x) + ...). Where f0, f1, ... is the function basis which ideally should be formed by orthogonal functions.
  • Field Details

    • evaluator

      Evaluator of functions.
    • afunc

      protected double[] afunc
      Array where results of function evaluations are stored.
    • ma

      protected int ma
      Number of function basis used as a linear combination of functions being fitted.
  • Constructor Details

    • SingleDimensionLinearFitter

      protected SingleDimensionLinearFitter()
      Constructor.
    • SingleDimensionLinearFitter

      protected SingleDimensionLinearFitter(double[] x, double[] y, double[] sig)
      Constructor.
      Parameters:
      x - input points x where a linear single dimensional function f(x) = a * f0(x) + b * f1(x) + ...
      y - result of evaluation of linear single dimensional function f(x) at provided x points.
      sig - standard deviations of each pair of points (x, y).
      Throws:
      IllegalArgumentException - if provided arrays don't have the same length.
    • SingleDimensionLinearFitter

      protected SingleDimensionLinearFitter(double[] x, double[] y, double sig)
      Constructor.
      Parameters:
      x - input points x where a linear single dimensional function f(x) = a * f0(x) + b * f1(x) + ...
      y - result of evaluation of linear single dimensional function f(x) at provided x points.
      sig - standard deviation of all pair of points assuming that standard deviations are constant.
      Throws:
      IllegalArgumentException - if provided arrays don't have the same length.
    • SingleDimensionLinearFitter

      protected SingleDimensionLinearFitter(LinearFitterSingleDimensionFunctionEvaluator evaluator) throws FittingException
      Constructor.
      Parameters:
      evaluator - evaluator to evaluate function at provided point and obtain the evaluation of function basis at such point.
      Throws:
      FittingException - if evaluation fails.
    • SingleDimensionLinearFitter

      protected SingleDimensionLinearFitter(LinearFitterSingleDimensionFunctionEvaluator evaluator, double[] x, double[] y, double[] sig) throws FittingException
      Constructor.
      Parameters:
      evaluator - evaluator to evaluate function at provided point and obtain the evaluation of function basis at such point.
      x - input points x where a linear single dimensional function f(x) = a * f0(x) + b * f1(x) + ...
      y - result of evaluation of linear single dimensional function f(x) at provided x points.
      sig - standard deviation of all pair of points assuming that standard deviations are constant.
      Throws:
      FittingException - if evaluation fails.
      IllegalArgumentException - if provided arrays don't have the same length.
    • SingleDimensionLinearFitter

      protected SingleDimensionLinearFitter(LinearFitterSingleDimensionFunctionEvaluator evaluator, double[] x, double[] y, double sig) throws FittingException
      Constructor.
      Parameters:
      evaluator - evaluator to evaluate function at provided point and obtain the evaluation of function basis at such point.
      x - input points x where a linear single dimensional function f(x) = a * f0(x) + b * f1(x) + ...
      y - result of evaluation of linear single dimensional function f(x) at provided x points.
      sig - standard deviation of all pair of points assuming that standard deviations are constant.
      Throws:
      FittingException - if evaluation fails.
      IllegalArgumentException - if provided arrays don't have the same length.
  • Method Details

    • getFunctionEvaluator

      public LinearFitterSingleDimensionFunctionEvaluator getFunctionEvaluator()
      Returns function evaluator to evaluate function at a given point and obtain the evaluation of function basis at such point.
      Returns:
      function evaluator.
    • setFunctionEvaluator

      public void setFunctionEvaluator(LinearFitterSingleDimensionFunctionEvaluator evaluator) throws FittingException
      Sets function evaluator to evaluate function at a given point and obtain the evaluation of function basis at such point.
      Parameters:
      evaluator - function evaluator.
      Throws:
      FittingException - if evaluation fails.
    • internalSetFunctionEvaluator

      private void internalSetFunctionEvaluator(LinearFitterSingleDimensionFunctionEvaluator evaluator) throws FittingException
      Internal method to set function evaluator to evaluate function at a given point and obtain the evaluation of function basis at such point.
      Parameters:
      evaluator - function evaluator.
      Throws:
      FittingException - if evaluation fails.
    • isReady

      public boolean isReady()
      Indicates whether provided instance has enough data to start the function fitting.
      Specified by:
      isReady in class Fitter
      Returns:
      true if this instance is ready to start the function fitting, false otherwise.