10178

# Choosing Initial Parameter Values for Nonlinear Regression

Fitting scattered experimental data with a multi-parameter model by nonlinear regression is frequently hampered by the difficulty in making sufficiently good guesses of the parameters' initial values. This Demonstration lets you plot the points from one of eight datasets and then use the model to generate a curve that approximately matches the data by manually adjusting the parameters’ values with sliders. The values that produce the visually matched curve are then used as the initial guesses to the regression procedure. The method is demonstrated with different scattered peaked datasets to be fitted with a double-stretched exponential model having four or five adjustable parameters. Hints: Start by matching first. Try the Gradient method if Automatic frequently fails.

### DETAILS

Snapshot 1: dataset 1 and corresponding curve after manually adjusting the parameters for successful completion of the regression using the Automatic method (five-parameter model where is to be fitted)
Snapshot 2: dataset 1 and corresponding curve after successful completion of the regression using the Automatic method (five-parameter model where is to be fitted)
Snapshot 3: dataset 6 and corresponding curve after manually adjusting the parameters resulting in unsuccessful completion of the regression using the Gradient method (four-parameter model where is fixed)
Snapshot 4: dataset 6 and corresponding curve after manually adjusting the parameters for successful completion of the regression using the Gradient method (four-parameter model where is fixed)
Snapshot 5: dataset 6 and corresponding curve after successful completion of the regression using the Gradient method (four-parameter model where is fixed)
This Demonstration shows how scattered peaked data can be successfully fitted by nonlinear regression by finding initial guesses close enough to the parameters' actual values to yield a successful fit. You may choose any one of eight datasets and then attempt to match its plotted points with a curve using the model parameters’ sliders. The fitting model serving as an example is in the form of a double-stretched exponential where >. A setter bar is first used to choose between a four-parameter version of the model where is fixed as a constant and , , , and are adjustable parameters, and a five-parameter version where is also an adjustable parameter.
To start the procedure, select a dataset and click the "fit and plot" button. With the method set to Automatic the regression will fail with the default parameter values, and the message "Fit failed!" will be displayed in red above the plot. By adjusting the parameters’ sliders—always start by moving the slider until the curve passes through the first data point—try to match the curve to the data points and click on the "fit and plot" button again until successful, in which case the regression correlation coefficient, , will be displayed in blue above the plot and the fitted parameter values will be shown to its left. Another option after failure is to change the method to Gradient. For these models and data sets the Gradient method is more likely to give a successful fit than Automatic. If both methods yield a successful fit, you should prefer the one giving the highest value. Additional controls let you change the regression's AccuracyGoal and PrecisionGoal.
After a successful fit, changing any control will erase the displayed and parameter values and signal that you are ready for a new fit attempt using the current slider settings as the parameters' initial values. To set the parameter sliders to the most recently fitted values, click the "set initial to fitted parameters" button. Click the "reset to default parameters" button to return the sliders to the original default parameter values.
An example of using this procedure with real experimental data can be found in [1].
Reference
[1] M. G. Corradini, M. D. Normand, M. Eisenberg, and M. Peleg, "Evaluation of a Stochastic Inactivation Model for Heat-Activated Spores of Bacillus spp.," Applied & Environmental Microbiology, 76, 2010 pp. 4402–4412.

### PERMANENT CITATION

 Share: Embed Interactive Demonstration New! Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details » Download Demonstration as CDF » Download Author Code »(preview ») Files require Wolfram CDF Player or Mathematica.

#### Related Topics

 RELATED RESOURCES
 The #1 tool for creating Demonstrations and anything technical. Explore anything with the first computational knowledge engine. The web's most extensive mathematics resource. An app for every course—right in the palm of your hand. Read our views on math,science, and technology. The format that makes Demonstrations (and any information) easy to share and interact with. Programs & resources for educators, schools & students. Join the initiative for modernizing math education. Walk through homework problems one step at a time, with hints to help along the way. Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet. Knowledge-based programming for everyone.