0README

simplex
|-- 0NOTE			local pedigrees of these files
|-- 0README			this file
|-- nelder-mead-paper.pdf	pdf of scans of Nelder-Mead (1965) classic
|-- Simplex-1991		directory - C sources (1991) and executables
|   |-- 0NOTE				obvious
|   |-- 0README				obvious
|   |-- Makefile			build, test simplex fits: ldhfit linefit
|   |-- Doc				directory - text docs, man page
|   |-- Ldh				directory - sources, etc.: ldh rxn rate 
|   |   `-- tests				directory - tests cf sgi &
|   |							    macosx results
|   |-- Lib				directory - sources: simplex  library
|   |-- Line				directory - sources, etc.: fit to line 
|   |   `-- tests				directory - tests; cf hand calc
|   |							    & cf sgi & macosx
|   |-- biphasic			directory - sources, etc.: explore 
|   |						    parallel reaction model for
|   |						    lexA cleavage (or whatever)
|   |-- lexa				directory - sources, etc.: fit lexA
|   |   |					    cleavage data to models
|   |   |-- results.B				directory - lexA models/fits
|   |   `-- results.B.corr			directory - more of above...
|   `-- mmfit				directory - sources, etc: test fit enz
|						    rate data with nonlinear
|						    vs reciprocal functions
`-- Simplex-1994		directory - C sources (1994) and executables
|   |-- 0README				obvious
    |-- Lib				directory - sources, etc: simplex lib,
    |	|					    simplex fit, man page
    |   |-- tests 				directory - tests cf sgi & 
    |   |						    macosx results
    |   `-- tests-14				directory - tests cf 1991 &
    |   						1994 progs (same data)
    `-- S				directory - S module for simplex fit


The code below this directory applies the Nelder-Mead simplex
algorithm to the problem of fitting a model to data.  There are
sources, executables, and applications, all compiled and working
under Mac OS X, for several simplex fitting programs in the hierrachy
under Simplex-1991:

The header lines of the man page for the simplex fit:

SIMPLEX(1)                       SIMPLEX-1991                       SIMPLEX(1)
NAME
       simplex-1991,  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  ]  input-
       file ] [ [ -o ] diskfile ]


The Nelder-Mead simplex algorithm is a directed search of parameter
space.  It is robust, more so tban most gradient searches or
algorithms that rely on inversion of a matrix of derivatives of a
model function. It is capable of handling somewhat pathological
functions.

In this regard, stable results are obtained for lactate dehydrogenase
(ldh) rate data, fit with a six-parameter function; and lexA
rate-of-cleavage data, fit with up to eight variable parameters
(two each per mutant and wild type).

For a description of the method, see the man page, "Simplex (1)",
and the documentation files under Simplex-1991/Doc.


I first met and used the algorithm about 1970.  To keep it available,
I have ported the code from machine to machine [Control Data
mainframe, Data General mini, S-100 micro, 286, 386, Sun, SGI Iris,
SGI Octane, and likely other hardware I have forgotten] and language
to language [Fortran under mainframe and mini, Basic then C for the
micro with CPM, Microport SysV Unix for the 286/386, Sun and SGI
Unices - Solaris and Irix, ...].  And now to Mac OSX.

However, the algorithms of the S and R language functions "nls" are
sufficiently robust to handle whatever nonlinear modeling problems
I have had recently.  "nls" is easier to use: the model function
is simple to write as a function parameter; no derivatives need be
coded; and graphics, statistical and other routines are in place.

Regardless, the code under this directory is solid.  If you have a difficult
fitting problem, the simplex method is very much worth a try.


There are sources for simplex fitting under the directory Simplex-1994.
However, the Simplex-1991 sources and functions are more to be
recommended to a prospective user: the screen and disk outputs are
controllable from the command line and are optionally much more
verbose.  The 1991 and 1994 programs give identical results with
the same set of data, except for differently-structured output.
The 1994 sources, derived from the 1991, were designed to be a
C-coded function for S, that could be loaded and called from within
S and S functions.  Thus the stanalone fitting programs under
Simple-1994 are afterthoughts.

For those interested in the implementation of the Nelder-Mead
algorithm and the matrix operations of the quadratic fit, the 1994
sources are more heavily commented than the 1991.


The Makefile in the directory "Simplex-1991" compiles, builds, and
tests two fitting programs, "ldhfit" and "linefit":

	cd Simplex-1994
	[make spotless]		#if you want to build from scratch
	make all		#to ensure linefit and ldhfit are built
	make testline
	make testldh
	make testldhx


Various directories have "0NOTE" and "0README" files: the latter likely to
have useful descriptions; the former, notes on porting, etc., of limited
interest except for myself.


In addition to the directories with the simplex library, documentatin,
and the two test programs (ldhfit and linefit), there are three
application directories under Simplex-1991:

	mmfit
		three programs to fit enzyme rate data to the
		Michaelis-Menten equation (rate law):
			mmfit - built from mmfit.c
				nonlinear least squares
			recipfit - from recipfit.c
				linear least squares fit of
				Lineweaver-Burke eqn
				with correct weights (1/V^4)
			recip_nowt - recip_nowt.c
				linear least squares fit of
				Lineweaver-Burke eqn, but....
				with wrong weighting (equal weights)

	lexa
		analysis of measurements of the pH dependence of
		the rate of autolysis (autocatalytic cleavage) of
		wild-type and mutant lexA (data from John Little's
		laboratory);
			data fit by two models:
				lexfitB (lexfitB.c) 
				lexfitken (lexfitken.c)
			models have up to eight variable parameters

			scripts to display fit results with crude graphics 
			program (piped to ttygraph):
				prep
				plotallB
				plot.theory
				etc.

			results in directories:
				Simplex-1991/lexa/results.B
				Simplex-1991/lexa/results.B.corr

	biphasic
		play with triangle of irreversible reactions, wrt
		cleavage of lexA.


John Rupley
 rupley@u.arizona.edu -or- jar@rupley.com
 30 Calle Belleza, Tucson AZ 85716 - (520) 325-4533; fax - (520) 325-4991
 Dept. Biochemistry & Molecular Biophysics, Univ. Arizona, Tucson AZ 85721
