Package cnuphys.splot.fit
Class ANonlinearFit
java.lang.Object
cnuphys.splot.fit.ANonlinearFit
- All Implemented Interfaces:
IValueGetter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
Get the chi square of the fitdouble[][]
Get the covariance matrixdouble[]
Get the fit parametersprotected abstract com.nr.model.MultiFuncd
getFunc()
protected abstract double[]
initialGuess
(Fit fit) double
value
(double x) This method is an "after the fact" evaluator.
-
Constructor Details
-
ANonlinearFit
Create a Error function Fit- Parameters:
fit
- the fit datatolerance
- the tolerance- Throws:
IllegalArgumentException
-
-
Method Details
-
getFitParameters
public double[] getFitParameters()Get the fit parameters- Returns:
- the fit parameters
-
getCovarianceMatrix
public double[][] getCovarianceMatrix()Get the covariance matrix- Returns:
- the covariance matrix
-
getChiSquare
public double getChiSquare()Get the chi square of the fit- Returns:
- the chi square
-
value
public double value(double x) This method is an "after the fact" evaluator. After the fit is complete is should be able to use the resulting fit parameters to simply evaluate the function at a given x. The default implementation uses the fitting function _func. This is good in that it guarantees consistency, but the fitting function also computes the derivatives so there is an inefficiency. NOTE: this function is NOT used by the fitting process. It is only for convenience, afterward, such as in plotting.- Specified by:
value
in interfaceIValueGetter
-
initialGuess
-
getFunc
protected abstract com.nr.model.MultiFuncd getFunc()
-