Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.astro.louisville.edu/software/astroimagej/imagej/api/ij/measure/CurveFitter.html
Дата изменения: Thu Dec 2 23:03:10 2010 Дата индексирования: Mon Oct 1 22:25:12 2012 Кодировка: Поисковые слова: hawaii |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ij.measure.CurveFitter
public class CurveFitter
Curve fitting class based on the Simplex method described in the article "Fitting Curves to Data" in the May 1984 issue of Byte magazine, pages 340-362. 2001/02/14: Modified to handle a gamma variate curve. Uses altered Simplex method based on method in "Numerical Recipes in C". This method tends to converge closer in less iterations. Has the option to restart the simplex at the initial best solution in case it is "stuck" in a local minimum (by default, restarted twice). Also includes settings dialog option for user control over simplex parameters and functions to evaluate the goodness-of-fit. The results can be easily reported with the getResultString() method. Kieran Holland (holki659 at student.otago.ac.nz) 2008/01/21: Modified to do Gaussian fitting by Stefan Woerz (s.woerz at dkfz.de).
Field Summary | |
---|---|
static int |
EXP_RECOVERY
|
static int |
EXP_WITH_OFFSET
|
static int |
EXPONENTIAL
|
static java.lang.String[] |
fitList
|
static java.lang.String[] |
fList
|
static int |
GAMMA_VARIATE
|
static int |
GAUSSIAN
|
static int |
IterFactor
|
static int |
LOG
|
static int |
LOG2
|
static int |
POLY2
|
static int |
POLY3
|
static int |
POLY4
|
static int |
POWER
|
static int |
RODBARD
|
static int |
RODBARD2
|
static int |
STRAIGHT_LINE
|
Constructor Summary | |
---|---|
CurveFitter(double[] xData,
double[] yData)
Construct a new CurveFitter. |
Method Summary | |
---|---|
int |
doCustomFit(java.lang.String equation,
double[] initialValues,
boolean showSettings)
|
void |
doFit(int fitType)
Perform curve fitting with the simplex method doFit(fitType) just does the fit doFit(fitType, true) pops up a dialog allowing control over simplex parameters alpha is reflection coefficient (-1) beta is contraction coefficient (0.5) gamma is expansion coefficient (2) |
void |
doFit(int fitType,
boolean showSettings)
|
double |
f(double[] p,
double x)
Returns formula value for parameters 'p' at 'x' |
static double |
f(int fit,
double[] p,
double x)
Returns 'fit' formula value for parameters "p" at "x" |
int |
getFit()
|
double |
getFitGoodness()
Get a measure of "goodness of fit" where 1.0 is best. |
java.lang.String |
getFormula()
|
int |
getIterations()
Get number of iterations performed |
static int |
getMax(double[] array)
Gets index of highest value in an array. |
int |
getMaxIterations()
Get maximum number of iterations allowed |
java.lang.String |
getName()
|
int |
getNumParams()
Get number of parameters for current fit formula |
double[] |
getParams()
Get the set of parameter values from the best corner of the simplex |
double[] |
getResiduals()
Returns residuals array ie. |
int |
getRestarts()
Get number of simplex restarts to do |
java.lang.String |
getResultString()
Get a string description of the curve fitting results for easy output. |
double |
getRSquared()
Returns R^2, where 1.0 is best. |
double |
getSD()
Returns the standard deviation of the residuals. |
double |
getSumResidualsSqr()
|
double[] |
getXPoints()
|
double[] |
getYPoints()
|
void |
setInitialParameters(double[] params)
Sets the initial parameters, which override the default initial parameters. |
void |
setMaxIterations(int x)
Set maximum number of iterations allowed |
void |
setRestarts(int n)
Set number of simplex restarts to do |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int STRAIGHT_LINE
public static final int POLY2
public static final int POLY3
public static final int POLY4
public static final int EXPONENTIAL
public static final int POWER
public static final int LOG
public static final int RODBARD
public static final int GAMMA_VARIATE
public static final int LOG2
public static final int RODBARD2
public static final int EXP_WITH_OFFSET
public static final int GAUSSIAN
public static final int EXP_RECOVERY
public static final int IterFactor
public static final java.lang.String[] fitList
public static final java.lang.String[] fList
Constructor Detail |
---|
public CurveFitter(double[] xData, double[] yData)
Method Detail |
---|
public void doFit(int fitType)
public void doFit(int fitType, boolean showSettings)
public int doCustomFit(java.lang.String equation, double[] initialValues, boolean showSettings)
public int getNumParams()
public double f(double[] p, double x)
public static double f(int fit, double[] p, double x)
public double[] getParams()
public double[] getResiduals()
public double getSumResidualsSqr()
public double getSD()
public double getRSquared()
r^2 = 1 - SSE/SSD where: SSE = sum of the squares of the errors SSD = sum of the squares of the deviations about the mean.
public double getFitGoodness()
public java.lang.String getResultString()
public int getIterations()
public int getMaxIterations()
public void setMaxIterations(int x)
public int getRestarts()
public void setRestarts(int n)
public void setInitialParameters(double[] params)
public static int getMax(double[] array)
Double
- array.
public double[] getXPoints()
public double[] getYPoints()
public int getFit()
public java.lang.String getName()
public java.lang.String getFormula()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |