Package gov.nih.mipav.model.algorithms
Class FitExponential
- java.lang.Object
-
- gov.nih.mipav.model.algorithms.NLConstrainedEngine
-
- gov.nih.mipav.model.algorithms.NLFittedFunction
-
- gov.nih.mipav.model.algorithms.FitExponential
-
public class FitExponential extends NLFittedFunction
FitExponential -fits an array of points to an exponential of the type y = a0 + a1*exp(a2*x).- Version:
- 0.9
- Author:
- William Gandler
- See Also:
NLConstrainedEngine
-
-
Field Summary
-
Fields inherited from class gov.nih.mipav.model.algorithms.NLFittedFunction
chisq, EPSILON, MAX_ITR, MIN_ITR, xSeries, yDataFitted, ySeries
-
Fields inherited from class gov.nih.mipav.model.algorithms.NLConstrainedEngine
a, absoluteConvergence, analyticalJacobian, bl, bounds, bu, ctrlMat, dyda, gues, internalScaling, iters, jacobian, maxIterations, nPts, outputMes, param, parameterConvergence, relativeConvergence, residuals, secondAllowed, stdv, tolerance
-
-
Constructor Summary
Constructors Constructor Description FitExponential()FitExponential - test constructor, builds and test function.FitExponential(int nPoints, double[] xData, double[] yData)FitExponential.FitExponential(int nPoints, float[] xData, float[] yData)Constructs new fit exponential.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcalculateChiSq()Calculates chi squaredprotected voidcalculateFittedY()Calculates yDataFittedvoiddisplayResults()Display results of displaying exponential fitting parameters.voiddriver()Starts the analysis.voidfitToFunction(double[] a, double[] residuals, double[][] covarMat)Fit to function - a0 + a1*exp(a2*x).protected Jama.MatrixgenerateResiduals()Calculates the residuals for a given function, not implemented since some functions might prefer to only use a subset of data points, or not use yDataFitted if working during an iterationprivate voidtestData()Test data to test fitting of exponential.-
Methods inherited from class gov.nih.mipav.model.algorithms.NLFittedFunction
getChisq, getFittedY, getMedian
-
Methods inherited from class gov.nih.mipav.model.algorithms.NLConstrainedEngine
dumpTestResults, fitToTestFunction, getChiSquared, getExitStatus, getIterations, getParameters, getResiduals, statusMessage
-
-
-
-
Constructor Detail
-
FitExponential
public FitExponential()
FitExponential - test constructor, builds and test function.
-
FitExponential
public FitExponential(int nPoints, double[] xData, double[] yData)FitExponential.- Parameters:
nPoints- number of points in the functionxData- DOCUMENT ME!yData- DOCUMENT ME!
-
FitExponential
public FitExponential(int nPoints, float[] xData, float[] yData)Constructs new fit exponential.- Parameters:
nPoints- Number of points in the functionxData- DOCUMENT ME!yData- DOCUMENT ME!
-
-
Method Detail
-
driver
public void driver()
Starts the analysis. For some reason a guess with the wrong sign for a2 will not converge. Therefore, try both sign and take the one with the lowest chi-squared value.- Overrides:
driverin classNLConstrainedEngine
-
displayResults
public void displayResults()
Display results of displaying exponential fitting parameters.- Specified by:
displayResultsin classNLFittedFunction
-
fitToFunction
public void fitToFunction(double[] a, double[] residuals, double[][] covarMat)Fit to function - a0 + a1*exp(a2*x).- Specified by:
fitToFunctionin classNLConstrainedEngine- Parameters:
a- The best guess parameter values.residuals- ymodel - yData.covarMat- The derivative values of y with respect to fitting parameters.
-
testData
private void testData()
Test data to test fitting of exponential.
-
calculateFittedY
protected void calculateFittedY()
Description copied from class:NLFittedFunctionCalculates yDataFitted- Specified by:
calculateFittedYin classNLFittedFunction
-
generateResiduals
protected Jama.Matrix generateResiduals()
Description copied from class:NLFittedFunctionCalculates the residuals for a given function, not implemented since some functions might prefer to only use a subset of data points, or not use yDataFitted if working during an iteration- Specified by:
generateResidualsin classNLFittedFunction- Returns:
-
calculateChiSq
protected void calculateChiSq()
Description copied from class:NLFittedFunctionCalculates chi squared- Specified by:
calculateChiSqin classNLFittedFunction
-
-