Package gov.nih.mipav.model.algorithms
Class FitRayleigh
- java.lang.Object
-
- gov.nih.mipav.model.algorithms.NLConstrainedEngine
-
- gov.nih.mipav.model.algorithms.NLFittedFunction
-
- gov.nih.mipav.model.algorithms.FitRayleigh
-
public class FitRayleigh extends NLFittedFunction
For -infinity < a < +infinity and b > 0 y = scale factor * (2/b)*(x - a)*exp(-((x-a)**2)/b)*u(x - a) where u(x-a) = 0 for x < a and = 1 for x >= a. cumulative function = [1 - exp(-((x-a)**2)/b)]*u(x-a) Mean of x = a + sqrt(PI*b/4) Variance of x = b*(4 - PI)/4
-
-
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 FitRayleigh()
Creates a new FitRayleigh object.FitRayleigh(int nPoints, float[] xData, float[] yData)
FitRayleigh.
-
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 linear fitting parameters.void
fitToFunction(double[] a, double[] residuals, double[][] jacobian)
Fit Rayleigh to function.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
setupData()
Sets up data to test fitting of Rayleigh distribution.-
Methods inherited from class gov.nih.mipav.model.algorithms.NLFittedFunction
getChisq, getFittedY, getMedian
-
Methods inherited from class gov.nih.mipav.model.algorithms.NLConstrainedEngine
driver, dumpTestResults, fitToTestFunction, getChiSquared, getExitStatus, getIterations, getParameters, getResiduals, statusMessage
-
-
-
-
Method Detail
-
displayResults
public void displayResults()
Display results of displaying linear fitting parameters.- Specified by:
displayResults
in classNLFittedFunction
-
fitToFunction
public void fitToFunction(double[] a, double[] residuals, double[][] jacobian)
Fit Rayleigh to function.- Specified by:
fitToFunction
in classNLConstrainedEngine
- Parameters:
a
- The best guess parameter values.residuals
- ymodel - yData.jacobian
- The derivative values of y with respect to fitting parameters.
-
setupData
private void setupData()
Sets up data to test fitting of Rayleigh distribution.
-
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
-
-