Package com.irurueta.numerical.fitting
Class SingleDimensionLinearFitter
java.lang.Object
com.irurueta.numerical.fitting.Fitter
com.irurueta.numerical.fitting.SingleDimensionFitter
com.irurueta.numerical.fitting.SingleDimensionLinearFitter
- Direct Known Subclasses:
SimpleSingleDimensionLinearFitter
,SvdSingleDimensionLinearFitter
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 Summary
FieldsModifier and TypeFieldDescriptionprotected double[]
Array where results of function evaluations are stored.Evaluator of functions.protected int
Number of function basis used as a linear combination of functions being fitted.Fields inherited from class com.irurueta.numerical.fitting.SingleDimensionFitter
a, chisq, covar, ndat, sig, x, y
Fields inherited from class com.irurueta.numerical.fitting.Fitter
resultAvailable
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Constructor.protected
SingleDimensionLinearFitter
(double[] x, double[] y, double sig) Constructor.protected
SingleDimensionLinearFitter
(double[] x, double[] y, double[] sig) Constructor.protected
Constructor.protected
SingleDimensionLinearFitter
(LinearFitterSingleDimensionFunctionEvaluator evaluator, double[] x, double[] y, double sig) Constructor.protected
SingleDimensionLinearFitter
(LinearFitterSingleDimensionFunctionEvaluator evaluator, double[] x, double[] y, double[] sig) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns function evaluator to evaluate function at a given point and obtain the evaluation of function basis at such point.private void
Internal method to set function evaluator to evaluate function at a given point and obtain the evaluation of function basis at such point.boolean
isReady()
Indicates whether provided instance has enough data to start the function fitting.void
Sets function evaluator to evaluate function at a given point and obtain the evaluation of function basis at such point.Methods inherited from class com.irurueta.numerical.fitting.SingleDimensionFitter
getA, getChisq, getCovar, getSig, getX, getY, setInputData, setInputData
Methods inherited from class com.irurueta.numerical.fitting.Fitter
fit, isResultAvailable
-
Field Details
-
evaluator
Evaluator of functions. -
afunc
protected double[] afuncArray where results of function evaluations are stored. -
ma
protected int maNumber 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
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.
-