Squiz Matrix
4.12.2
|
Public Member Functions | |
CurveFitter (double[] xData, double[] yData) | |
void | doFit (int fitType) |
void | doFit (int fitType, boolean showSettings) |
int | getNumParams () |
double[] | getParams () |
double[] | getResiduals () |
double | getSumResidualsSqr () |
double | getSD () |
double | getFitGoodness () |
String | getResultString () |
int | getIterations () |
int | getMaxIterations () |
void | setMaxIterations (int x) |
int | getRestarts () |
void | setRestarts (int x) |
Static Public Member Functions | |
static double | f (int fit, double[] p, double x) |
static int | getMax (double[] array) |
Static Public Attributes | |
static final int | STRAIGHT_LINE =0 |
static final int | IterFactor = 500 |
static final String[] | fitList |
static final String[] | fList |
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: Midified 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 once). 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.
Definition at line 22 of file CurveFitter.java.
|
inline |
Construct a new CurveFitter.
Definition at line 57 of file CurveFitter.java.
|
inline |
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)
Definition at line 70 of file CurveFitter.java.
|
inlinestatic |
Returns "fit" function value for parametres "p" at "x"
Definition at line 328 of file CurveFitter.java.
|
inline |
Get a measure of "goodness of fit" where 1.0 is best.
Definition at line 409 of file CurveFitter.java.
|
inline |
Get number of iterations performed
Definition at line 477 of file CurveFitter.java.
|
inlinestatic |
Gets index of highest value in an array.
Double | array. |
Definition at line 507 of file CurveFitter.java.
|
inline |
Get maximum number of iterations allowed
Definition at line 482 of file CurveFitter.java.
|
inline |
Get number of parameters for current fit function
Definition at line 311 of file CurveFitter.java.
|
inline |
Get the set of parameter values from the best corner of the simplex
Definition at line 377 of file CurveFitter.java.
|
inline |
Returns residuals array ie. differences between data and curve.
Definition at line 383 of file CurveFitter.java.
|
inline |
Get number of simplex restarts to do
Definition at line 492 of file CurveFitter.java.
|
inline |
Get a string description of the curve fitting results for easy output.
Definition at line 428 of file CurveFitter.java.
|
inline |
SD = sqrt(sum of residuals squared / number of params+1)
Definition at line 401 of file CurveFitter.java.
|
inline |
Set maximum number of iterations allowed
Definition at line 487 of file CurveFitter.java.
|
inline |
Set number of simplex restarts to do
Definition at line 497 of file CurveFitter.java.
|
static |
Definition at line 28 of file CurveFitter.java.
|
static |
Definition at line 32 of file CurveFitter.java.