Package gov.nih.mipav.model.algorithms
Class FitMultiExponential
- java.lang.Object
-
- gov.nih.mipav.model.algorithms.NLConstrainedEngine
-
- gov.nih.mipav.model.algorithms.NLFittedFunction
-
- gov.nih.mipav.model.algorithms.FitMultiExponential
-
public class FitMultiExponential extends NLFittedFunction
FitMultiExponential -fits an array of points to an multiexponential of the type y = a0 + a1*exp(a2*x) + a3*exp(a4*x) + ... where all the exponentials are negative decaying exponentials.- 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 FitMultiExponential()
FitMultiExponential - test constructor, builds and test function.FitMultiExponential(int nPoints, int nCoefficients, double[] xData, double[] yData)
FitMultiExponential assuming all exponentials are negativeFitMultiExponential(int nPoints, int nCoefficients, float[] xData, float[] yData)
Constructs new fit multiexponential assuming all exponentials are negative.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
calculateChiSq()
Calculates chi squaredprotected void
calculateFittedY()
Calculates yDataFittedvoid
displayResults()
Display results of displaying exponential fitting parameters.void
driver()
Starts the analysis.void
fitToFunction(double[] a, double[] residuals, double[][] covarMat)
Fit to function - a0 + a1*exp(a2*x) + a3*exp(a4*x) + ...protected Jama.Matrix
generateResiduals()
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 void
testData()
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
-
FitMultiExponential
public FitMultiExponential()
FitMultiExponential - test constructor, builds and test function.
-
FitMultiExponential
public FitMultiExponential(int nPoints, int nCoefficients, double[] xData, double[] yData)
FitMultiExponential assuming all exponentials are negative- Parameters:
nPoints
- number of points in the functionnCoefficients
- number of variables in the functionxData
- DOCUMENT ME!yData
- DOCUMENT ME!
-
FitMultiExponential
public FitMultiExponential(int nPoints, int nCoefficients, float[] xData, float[] yData)
Constructs new fit multiexponential assuming all exponentials are negative.- Parameters:
nPoints
- Number of points in the functionnCoefficients
- Number of variables in the functionxData
- DOCUMENT ME!yData
- DOCUMENT ME!
-
-
Method Detail
-
driver
public void driver()
Starts the analysis.- Overrides:
driver
in classNLConstrainedEngine
-
displayResults
public void displayResults()
Display results of displaying exponential fitting parameters.- Specified by:
displayResults
in classNLFittedFunction
-
fitToFunction
public void fitToFunction(double[] a, double[] residuals, double[][] covarMat)
Fit to function - a0 + a1*exp(a2*x) + a3*exp(a4*x) + ...- Specified by:
fitToFunction
in 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:NLFittedFunction
Calculates yDataFitted- Specified by:
calculateFittedY
in classNLFittedFunction
-
generateResiduals
protected Jama.Matrix generateResiduals()
Description copied from class:NLFittedFunction
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 iteration- Specified by:
generateResiduals
in classNLFittedFunction
- Returns:
-
calculateChiSq
protected void calculateChiSq()
Description copied from class:NLFittedFunction
Calculates chi squared- Specified by:
calculateChiSq
in classNLFittedFunction
-
-