Chapter 9.1 Parameter Fitting
Generating Analytic Functions
When this option is chosen, a panel appears with a single exponential decay as the default function with default parameter values of unity; the curve is plotted in the graphic window below the control panel. One may immediately see the effect of changing the parameter values.

Several common analytic functions are available via a cursor click on "Fit to Data" 
followed by the selection of "Common Functional Forms"

Selection of one of these immediately brings in "Args" (Arguments) and a "Y-expr" (Yexpression) into their respective fields. Alternatively
one may write an arbitrary function in the "Y-expr" field, and naming the arguments in the "Args" field.
There are several useful options available already. From the "Print & File Manager Window":
- The curve may be printed directly for a figure
- The curve may be saved as a file for later evaluation of the quality
of fitting, as illustrated below, by:
- the same or
- other similar functional forms
- the two fitting algorithms
Fitting Data with Analytic Functions
Fitting of data files with analytic functions is simple and straight forward with
the facilities contained in this panel.
- Data to be fittted by an analytic form may be imported pressing the "Fit to Data" button and selecting the first option, "Read Data File".
- Assigning parameter names in the "Args" field
- Selecting the functional form from the built in ones or written in "Y-expr"
- Choosing different (from the default) starting values for the parameters. The analytic function
updates as the inital guesses (or starting point for the fitter) are altered. The effect of some choices of starting points are described later.
- Selecting "Fit to Data" option under the "Fit to Data" button
- Choosing one of the two fitting routines, "Simplex" and "Praxis"

As the fitting takes place, the analytic function curve changes as well as
the currently used parameter values.
Illustration of Generation and Fitting Exponential Decays
I have illustrated the use of these features by reproducing the exponential curves used earlier in the discussion fitting difficulties in Chap. 3. Professional Style. The steps involved were to:
- Choose a Double Exponential from the common forms menu
- Add an additional term to the Y-expression and Arguments. (Of course I could have written out the whole expression de novo)
- Set the parameter values as in the previous example
- Save this curve in a data file (filename.dat) by choosing "Print to file" (in the Print & File Window Manager) and then the Ascii format.
- Edit the file so that the header (first line) to remove text and leave only the number of points in the curve (as pairs of y & t).
- Read that data file back in via the "Fit to Data" and "Read Data File" buttons.
- Select Double Exponential from the common forms menu
- Select "Fit to Data" and going with the "Simplex" fitting routine
The result to these operations is shown here where on can see that the best fitting double exponential parameters found were the same as those shown previously in Chap. 3.
Other Examples using HH
Other examples of parameter fitting have been added to illustrate finding the parameters of curves where the data are of a known
form (as in the HH equations).
m-infinity. In the Hodgkin-Huxley expression for the sodium conductance the values of the steady state of "m" ("hh_minf" in NEURON) were generated by NEURON. The curve was saved as a Ascii file and edited for importation into the "Run Fitter". When the "Read Data File" option under the "Fit to Data" button was selected, and the minf.dat file chosen, the points
in the curve below appeared.
"Double Boltzman" was selected from the 'Common Forms" submenu as the expression to fit this data. It was clear that adjustment of the parameters A & k would not provide a fit. Therefore a voltage shift was added to the 'Args" and "Y-expr"
fields. Thus when a "Fit Data" selection was made, the Two-state Boltzman expression provided a very nice fit.
Kinetics of m. Similarly a curve of m^3 as a function of time was generated under
NEURON, saved as an Ascii file, and imported into the Parameterized Fitter. Here the "Y-expr" chosen was a first order lag
(from the 'Common Forms" submenu) and the third power was
entered with the field editor. When the Fit to Data selection was made
a rather clean fit was obtained.
Back to:
On to: