SIMPLEX(1) USER COMMANDS SIMPLEX(1) SIMPLEX simplex, simpfit - Nelder-Mead simplex minimization for parameter estimates with standard deviations SYNOPSIS xxxxfit [ -s {a|c|l|n} ] [ -d {a|c|l|n} ] [ [ -i ] inputfile ] [ [ -o ] diskfile ] DESCRIPTION A model function explicitly relating a dependent variable to one or more independent variables and variable parameters is fit to a set of data points (observed values of dependent and independent variables). The Nelder-Mead algorithm is used to locate the least squares minimum by a simplex search procedure, giving estimates of the best-fit values of the parameters of the model function. Standard deviations of the parameters are estimated by use of a quadratic approxi- mation of the least squares surface near the minimum. The quadratic approximation, equivalent to minimization by use of a Taylor's series approximation, returns improved parame- ter estimates. Thus the quadratic approximation can be used as part of the minimization procedure. Alternation of a cycle of simplex minimization, consisting of perhaps 30 iterations, with a cycle of quadratic minimi- zation is an effective strategy. The simplex search effi- ciently defines the region of parameter space that contains the minimum; bounds are easily incorporated; because deriva- tives are not used, ill-behaved functions can be handled. The quadratic minimization, on the other hand, efficiently finds the least squares minimum, but it is reliable only when near the minimum. If the quadratic minimization fails, as it often will in the early stages of the search, consid- erable time is wasted, to reduce which, the next one or several cycles of quadratic minimization can be skipped after a failure. The files input.doc and output.doc should be read for details of the entry of data and interpretation of output. Several routines have to be recoded for each new model func- tion. (1) func() calculates for a simplex vertex (for the set of parameter values passed to it): (a) the value of the dependent variable for each data point and (b) the least squares function (the weighted sum of residuals squared) over all data points. Bounds on parameters can be imple- mented easily, by a test that returns an excessively large least squares function value (e.g., 1.E38). Code should be efficient; most of the minimization is spent in func(). (2) The print statement of fdatprint(), which lists calculated and input values for the set of data points, may have to be recoded after change in the function or data. fdatprint() Sun Release 4.1 Last change: 1 SIMPLEX(1) USER COMMANDS SIMPLEX(1) calls fpointprint(), which gives additional customizable data-related output. (3) fspecial() controls a customizable display printed after the standard display at the end of each iteration of the simplex minimization. COMMAND LINE OPTIONS -s {a|c|l|n} -- control output to terminal; default is all possible output ( a ): a = ALL possible output; information tracking each iteration of the simplex minimization is displayed. c = summary output each CYCLE of perhaps 30 iterations; any output from a quadratic minimization is displayed at this point. l = summary output on LAST cycle only; n = NO output; -d {a|c|l|n} -- control output to diskfile, with options as for control of terminal output; default is summary output ( c ): [ -i ] inputfile -- specify input file; default is stdin. [ -o ] diskfile -- specify output file; default is /dev/null, i.e., no output is saved unless requested. The input file has the following structure: one-line title, with no tabs or ctrl characters; lines following give control variables, the starting simplex, and the data array; the order of entry is fixed by the order in read_data(); see sample data file for structure, and also the description in input.doc; the one-word descriptors must be present in the data file; the data format is otherwise free-form; comments at the end of the file are not read by the program FILES The files linefit.c and ldhfit.c are examples of coding for specific functions. The files linefit.dat and ldhfit.dat are sample input files, with typical values of the control variables. Sun Release 4.1 Last change: 2 SIMPLEX(1) USER COMMANDS SIMPLEX(1) There are several documentation files: Simplex.doc describes the Nelder-Mead algorithm and the mechanics of the quadratic fit. Output.doc describes the full ( a option) output for the minimization. Input.doc is a template file, showing the style of data entry, with comments. Data_redn.doc contains low-level comments on data reduction and a description of the model coded in ldhfit.c. AUTHOR J. A. Rupley, Tucson, Arizona rupley!local@megaron.arizona.edu BUGS There are limits, set in simpdefs.h, on the number of param- eters, data points, and variables for each data point. Sun Release 4.1 Last change: 3