Next: , Previous: , Up: Internal Routines   [Contents][Index]

15.5.234 fit3

par = fit3( x=x, y=y, start=start, step=step, f=funcname [, err=errors, ithresh=ithresh, sthresh=sthresh, nithresh=nithresh] [, /vocal])

Seeks parameters par such that funcname(par, x, y) is as small as possible, using the Simplex algorithm. start specifies the startup values for the parameters. step specifies the initial step size for each of the parameters, for searching for the minimum. funcname must be a string that names the user-defined function to call to obtain the quality of the fit. This function is assumed to return the sum of the square of the residuals between the data and the model for the current set of parameters.

ithresh specifies the maximum number of search iterations that is done. It defaults to 0, which corresponds to no iteration limit.

The search algorithm searches a certain volume of parameter space for the minimum. During every iteration it updates the vertex corresponding to the greatest function value, to home in on the location of the minimum. sthresh specifies below which size of the search volume the iteration should stop. The used measure is the root-mean-square distance of all vertices from the center of the search volume. This size may increase or decrease, and need not end up at zero.

If the best fit does not improve for more than nithresh consecutive search iterations, then the iteration stops. A value of 0 corresponds to no limit. It defaults to 10 times the number of parameters.

Upon exit, the last element of par contains the standard deviation of the difference between y and funcname(par, x, y). If errors is specified, then the estimated standard errors on the parameters are returned in it.

If /vocal is specified, then about every 2 seconds a line is printed that lists (1) the iteration number, (2) the residual standard error of the current best fit, (3) the difference with the previously printed residual standard error, (4) a measure of the linear size of the multidimensional volume that is being considered, (5) the difference with the previously printed size, (6) the current best values for the first few parameters that have a non-zero step size.

See also: fit

Next: , Previous: , Up: Internal Routines   [Contents][Index]