Package com.irurueta.numerical.fitting
Class SingleDimensionFitter
java.lang.Object
com.irurueta.numerical.fitting.Fitter
com.irurueta.numerical.fitting.SingleDimensionFitter
- Direct Known Subclasses:
LevenbergMarquardtSingleDimensionFitter
,SingleDimensionLinearFitter
Base class to fit a single dimension function y = f(x) by using provided
data (x, y)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double[]
Estimated parameters of single dimensional function.protected double
Estimated chi square value of input data.protected com.irurueta.algebra.Matrix
Covariance of estimated parameters of single dimensional function.protected int
Number of samples (x, y) in provided input data.protected double[]
Standard deviations of each pair of points (x,y).protected double[]
Input points x where function f(x) is evaluated.protected double[]
Result of evaluation of linear single dimensional function f(x) at provided x points.Fields inherited from class com.irurueta.numerical.fitting.Fitter
resultAvailable
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Constructor.protected
SingleDimensionFitter
(double[] x, double[] y, double sig) Constructor.protected
SingleDimensionFitter
(double[] x, double[] y, double[] sig) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
getA()
Returns estimated parameters of linear single dimensional function.double
getChisq()
Returns estimated chi square value of input data.com.irurueta.algebra.Matrix
getCovar()
Returns covariance of estimated parameters of linear single dimensional function.double[]
getSig()
Returns standard deviations of each pair of points (x,y).double[]
getX()
Returns input points x where function f(x) is evaluated.double[]
getY()
Returns result of evaluation of linear single dimensional function f(x) at provided x points.final void
setInputData
(double[] x, double[] y, double sig) Sets required input data to start function fitting and assuming constant standard deviation errors in input data.final void
setInputData
(double[] x, double[] y, double[] sig) Sets required input data to start function fitting.Methods inherited from class com.irurueta.numerical.fitting.Fitter
fit, isReady, isResultAvailable
-
Field Details
-
x
protected double[] xInput points x where function f(x) is evaluated. -
y
protected double[] yResult of evaluation of linear single dimensional function f(x) at provided x points. This is provided as input data along with x array. -
sig
protected double[] sigStandard deviations of each pair of points (x,y). -
ndat
protected int ndatNumber of samples (x, y) in provided input data. -
a
protected double[] aEstimated parameters of single dimensional function. -
covar
protected com.irurueta.algebra.Matrix covarCovariance of estimated parameters of single dimensional function. -
chisq
protected double chisqEstimated chi square value of input data.
-
-
Constructor Details
-
SingleDimensionFitter
protected SingleDimensionFitter()Constructor. -
SingleDimensionFitter
protected SingleDimensionFitter(double[] x, double[] y, double[] sig) Constructor.- Parameters:
x
- input points x where function f(x) is evaluated.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.
-
SingleDimensionFitter
protected SingleDimensionFitter(double[] x, double[] y, double sig) Constructor.- Parameters:
x
- input points x where function f(x) is evaluated.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.
-
-
Method Details
-
getX
public double[] getX()Returns input points x where function f(x) is evaluated.- Returns:
- input points x.
-
getY
public double[] getY()Returns result of evaluation of linear single dimensional function f(x) at provided x points. This is provided as input data along with x array.- Returns:
- sampled function evaluations.
-
getSig
public double[] getSig()Returns standard deviations of each pair of points (x,y).- Returns:
- standard deviations of each pair of points (x,y).
-
setInputData
public final void setInputData(double[] x, double[] y, double[] sig) Sets required input data to start function fitting.- 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. This is provided as input data along with x array.sig
- standard deviations of each pair of points (x,y).- Throws:
IllegalArgumentException
- if provided arrays don't have the same size.
-
setInputData
public final void setInputData(double[] x, double[] y, double sig) Sets required input data to start function fitting and assuming constant standard deviation errors in input data.- 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 size.
-
getA
public double[] getA()Returns estimated parameters of linear single dimensional function.- Returns:
- estimated parameters.
-
getCovar
public com.irurueta.algebra.Matrix getCovar()Returns covariance of estimated parameters of linear single dimensional function.- Returns:
- covariance of estimated parameters.
-
getChisq
public double getChisq()Returns estimated chi square value of input data.- Returns:
- estimated chi square value of input data.
-