The Nelder-Mead simplex method locates a function minimum by a guided search in parameter space. Derivatives are not used. A best-fit set of parameters is obtained directly. A quadratic approximation of the least squares function surface in the neighborhood of the minimum gives the variance-covariance matrix and the standard deviations of the parameters. Alternating cycles of simplex minimization and quadratic approximation more efficiently converge on the function minimum. The method can be used to fit a nonlinear model to a set of data, in which case the function minimized is the least squares test, the weighted sum of residuals squared. The program is stable enough to survive an undergraduate laboratory. A version of it has moved with me from Fortran on a main frame, to Fortran on a mini, to CP/M basic, to CP/M C, to UNIX, and now to S. Perhaps others will find it as handy to have around as I have. This package includes a core set of routines that constitute the minimizer: simpmain.c, simpfit.c, simpdev.c, simplib0.c. The two sides of the C<->S interface are in the files: simpS.c and simpfit.S. The front end for a stand alone UNIX excecutable is in the file: simpfront.c. As documentation, there is a UNIX man page (simplex.1) and an S help file (simpfit.d). The C source code for the Nelder-Mead minimizer (simpfit.c) and for the quadratic approximation (simpdev.c) are heavily commented. For additional documentation, please see the classic article by Nelder and Mead (Computer J., 7, 308, 1965). The user has to write a C or an S function specifically for the function to be minimized, to return the function value for the set of parameter estimates passed to it. Several example C and S source files and the corresponding data files are included: 1. Powell's quartic function, used in tests by Nelder and Mead (1965): C code - powell.c, powell.dat, powell.out S code - powell.S 2. The "Puromycin" enzyme kinetic data, part of the package nonlin, by Bates and Watts, and Dalgaard, available from statlib: S code - Puro.S 3. Test data for fit of enzyme initial rate measurements (two substrates, with product inhibition) to a rate law with 6 variable parameters: C code - ldhfit.c, ldhfit.dat, ldhfit.out S code - ldhfn.S TO GENERATE AND TEST THE S VERSION: The code has been tested on an Iris 4D30, under Irix 4.0.1 and AT&T 1989 S. Irix is SysV and does not have dynamic loading. For a statically loaded S version, in the directory with this package, type: make #the Makefile default generates the .o files #needed for the local version of S; #you may need to alter the CFLAGS and #LIBES lines of the Makefile S LOAD *.o #generate local.Sqpe with the simp*.o #files included cp simpfit.d ~whoever/.Data/.Help then in S: source("simpfit.S") source("Puro.S") simpfit(Puro, c(205, 0.08), ndata=12) source("powell.S") simpfit(powell, powell.p, exittest=-1.e-20) source("ldhfn.S") simpfit(ldhfn, ldhfn.p, data=ldhfn.dat) for use in adding to a library, the above .S functions have been combined: cat *.S >simpfit.all.s TO GENERATE AND TEST THE STAND ALONE UNIX VERSION: Alter the CLFAGS and LIBES lines of the Makefile as needed; then make testall diff *.test vs *.out files.