Class SvdMultiDimensionLinearFitter


public class SvdMultiDimensionLinearFitter extends MultiDimensionLinearFitter
Fits provided data (x,y) to a function made of a linear combination of functions used as a basis (i.e. f(x1, x2, ...) = a * f0(x1, x2, ...) + b * f1(x1, x2, ...) + ...). Where f0, f1, ... is the function basis which ideally should be formed by orthogonal function. This class is based on the implementation available at Numerical Recipes 3rd Ed, page 795.
  • Field Details

    • DEFAULT_TOL

      public static final double DEFAULT_TOL
      Default tolerance.
      See Also:
    • tol

      private double tol
      Tolerance to define convergence threshold for SVD.
  • Constructor Details

    • SvdMultiDimensionLinearFitter

      public SvdMultiDimensionLinearFitter(com.irurueta.algebra.Matrix x, double[] y, double[] sig)
      Constructor.
      Parameters:
      x - input points x where a linear multi-dimensional function f(x1, x2, ...) = a * f0(x1, x2, ...) + b * f1(x1, x2, ...) + ...
      y - result of evaluation of linear multi-dimensional function f(x1, x2, ...) at provided x points.
      sig - standard deviations of each pair of points (x, y).
      Throws:
      IllegalArgumentException - if provided matrix rows and arrays don't have the same length.
    • SvdMultiDimensionLinearFitter

      public SvdMultiDimensionLinearFitter(com.irurueta.algebra.Matrix x, double[] y, double sig)
      Constructor.
      Parameters:
      x - input points x where a linear multi-dimensional function f(x1, x2, ...) = a * f0(x1, x2, ...) + b * f1(x1, x2, ...) + ...
      y - result of evaluation of linear multi-dimensional function f(x1, x2, ...) at provided x points.
      sig - standard deviation of all pair of points assuming that standard deviations are constant.
      Throws:
      IllegalArgumentException - if provided matrix rows and arrays don't have the same length.
    • SvdMultiDimensionLinearFitter

      public SvdMultiDimensionLinearFitter(LinearFitterMultiDimensionFunctionEvaluator 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.
    • SvdMultiDimensionLinearFitter

      public SvdMultiDimensionLinearFitter(LinearFitterMultiDimensionFunctionEvaluator evaluator, com.irurueta.algebra.Matrix 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 multi-dimensional function f(x1, x2, ...) = a * f0(x1, x2, ...) + b * f1(x1, x2, ...) + ...
      y - result of evaluation of linear multi-dimensional function f(x1, x2, ...) at provided x points.
      sig - standard deviations of each pair of points (x, y).
      Throws:
      FittingException - if evaluation fails.
      IllegalArgumentException - if provided matrix rows and arrays don't have the same length.
    • SvdMultiDimensionLinearFitter

      public SvdMultiDimensionLinearFitter(LinearFitterMultiDimensionFunctionEvaluator evaluator, com.irurueta.algebra.Matrix 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 multi-dimensional function f(x1, x2, ...) = a * f0(x1, x2, ...) + b * f1(x1, x2, ...) + ...
      y - result of evaluation of linear multi-dimensional function f(x1, x2, ...) 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 matrix rows and arrays don't have the same length.
    • SvdMultiDimensionLinearFitter

      SvdMultiDimensionLinearFitter()
      Constructor.
  • Method Details

    • getTol

      public double getTol()
      Returns tolerance to define convergence threshold for SVD.
      Returns:
      tolerance to define convergence threshold for SVD.
    • setTol

      public void setTol(double tol)
      Sets tolerance to define convergence threshold for SVD.
      Parameters:
      tol - tolerance to define convergence threshold for SVD.
    • fit

      public void fit() throws FittingException, NotReadyException
      Fits a function to provided data so that parameters associated to that function can be estimated along with their covariance matrix and chi square value.
      Specified by:
      fit in class Fitter
      Throws:
      FittingException - if fitting fails.
      NotReadyException - if enough input data has not yet been provided.