## Model Library

#### for the Nonlinear Least Squares Curve Fitter

Revised 03/24/2000

This page contains a large collection of "models", or functions, that arise in linear and nonlinear curve fitting. For each function, there is a short description of the model, followed by a table showing what has to be entered into the curve fitting page. You can copy and paste the function from this page into the function box on the curve fitting page.

### Simple linear models:

Lin1: Straight line. This is the classic least squares straight line. There are many web pages that fit straight lines. One reason for using the Nonlinear Curve Fitter is for the extra information it provides: parameter error estimates, confidence bands, etc.
 Independent Variables: 1 Parameters: 2 Function to be fitted: y= a + b * x Initial Parameter Guesses: a=0, b=0 (convergence is guaranteed)

Lin2: Straight line passing through the origin. This model does not include the "intercept", or "constant term". It should be used only when you know that the fitted line must pass through the origin.
 Independent Variables: 1 Parameters: 1 Function to be fitted: y= a * x Initial Parameter Guesses: a=0 (convergence is guaranteed)

Lin3: Horizontal Straight Line. This model is so trivially simple that it's almost never used. In fact, it hardly fits into the category of "curve fitting" because there's really no curve involved at all. Basically, you would be using the web page to compute simple "descriptive statistics" on a set of numbers.
 Independent Variables: 0 Parameters: 1 Function to be fitted: y= a Initial Parameter Guesses: a=0 (convergence is guaranteed)

Lin4: Parabola. This model can be used to test for significant non-linearity in the data (in which case the c parameter will be significantly different from zero).
 Independent Variables: 1 Parameters: 3 Function to be fitted: y= a + b * x + c * x*x Initial Parameter Guesses: a,b,c=0 (convergence is guaranteed)

Lin5: Polynomial. This fits any polynomial up to 7 order. The function below may not look like a polynomial because it is written in "factored" form, which is more efficient to compute than the usual form. Note: Never fit a parabola to data that "levels off" horizontally for large or small values of x.
 Independent Variables: 1 Parameters: anything from 1 through 8 (1 = constant; 2 = straight line; 3 = parabola; 4 = cubic; 5 = quartic; etc. Function to be fitted: y= a + x*(b + x*(c + x*(d + x*(e + x*(f + x*(g + x*h)))))) Initial Parameter Guesses: all=0 (convergence is guaranteed). Be sure to set all parameter guesses to zero, especially the "extra" parameters beyond what you're fitting, or the results will be incorrect.

Lin6: Multivariate linear regression.
 Independent Variables: anything from 1 through 7 Parameters: anything from 1 through 8 Function to be fitted: y= a + b*x1 + c*x2 + d*x3 + e*x4 + f*x5 + g*x6 + h*x7 Initial Parameter Guesses: all=0 (convergence is guaranteed). Be sure to set all parameter guesses to zero, especially the "extra" parameters beyond what you're fitting, or the results will be incorrect.

### Exponential Decay Curves:

Exp1: Single Exponential decay to zero. This is the basic fit for exponential decay. It would be used for data that would be a straight line on semi-log graph paper.
 Independent Variables: 1 Parameters: 2 Function to be fitted: y= a * Exp(- b * t ) Initial Parameter Guesses: a: the value of y when t=0 b: the exponential constant; guess 0.7/half-time; positive for a decreasing exponential; negative for an increasing exponential.

Exp2: Single Exponential decay to an arbitrary value. This contains an extra parameter to allow for the curve leveling off to a value different from zero.
 Independent Variables: 1 Parameters: 3 Function to be fitted: y= ( a - c ) * Exp( - b * t ) + c Initial Parameter Guesses: a: the value of y when t=0 b: the exponential constant; guess 0.7/half-time; positive for a decreasing exponential; negative for an increasing exponential c: the "leveling-off" (asymptotic) value, for large t

Exp3: Multiple Exponential decay to zero.
 Independent Variables: 1 Parameters: 2 for a single exponential, 4 for a double exponential, 6 for triple, or 8 for quadruple. Function to be fitted: y= p1*Exp(-p2*t) + p3*Exp(-p4*t) + p5*Exp(-p6*t) + p7*Exp(-p8*t) Initial Parameter Guesses: p1, p3, p5, p7: the "amplitudes" of the individual exponential components. p2, p4, p6, p8: the corresponding exponential constants; each is equal to 0.7/half-life for that exponential component. Be sure to set the "extra" parameters (beyond what you're fitting) to zero, or the results will be incorrect.

Exp4: Multiple Exponential decay to an arbitrary value.
 Independent Variables: 1 Parameters: 3 for a single exponential, 5 for a double exponential, or 7 for triple Function to be fitted: y= p1 + p2*Exp(-p3*t) + p4*Exp(-p5*t) + p6*Exp(-p7*t) Initial Parameter Guesses: p1: the leveling-off value for large t p2, p4, p6: the "amplitudes" of the individual exponential components. p3, p5, p7: the corresponding exponential constants; each is equal to 0.7/half-life for that exponential component.

Exp5: Half-life form, decay to zero: This model is algebraically equivalent to the "single exponential decay to zero" model, but directly produces the half-time estimate instead of the rate constant.
 Independent Variables: 1 Parameters: 2 Function to be fitted: y= a / Power( 2 , t/b ) Initial Parameter Guesses: a: the value of y when t=0 b: the half-time

Exp6: Half-life form, decay to an arbitrary value. This model is algebraically equivalent to the "single exponential decay to an arbitrary value" model, but directly produces the half-time estimate instead of the rate constant.
 Independent Variables: 1 Parameters: 3 Function to be fitted: y= ( a - c ) / Power( 2 , t/b ) + c Initial Parameter Guesses: a: the value of y when t=0 b: the half-time c: the "leveling-off" (asymptotic) value, for large t

### Temperature-dependence Models

Temp1: log-vs-reciprocal. Y is some temperature-dependent quantity; t is the absolute temperature (usually degrees Kelvin).
 Independent Variables: 1 Parameters: 2 Function to be fitted: y= Exp( a - b / t ) Initial Parameter Guesses: a: empirical; value depends on units of t and y b: usually related to an energy of activation for some underlying process

Temp2: Antoine Equation. An empirical extension of the log-reciprocal model, containing an extra parameter. t is usually given in degrees celsius, not absolute temperature.
 Independent Variables: 1 Parameters: 3 Function to be fitted: y= Exp( a - b/(x+c) ) Initial Parameter Guesses: a: empirical; value depends on units of x and y b: usually related to an energy of activation for some underlying process c: an empirical parameter, usually near 273 for celsius t.

### Growth Curves:

Logit Equation.

Probit Equation.

Rossevik Curve for Fetal Growth

Simple ascending asymptotic growth

Simple descending asymptotic growth

### Pharmacokinetic Models:

Michaelis-Menten.

One compartment, bolus dose

One compartment, continuous infusion

etc., etc.

Return to the Non-linear Curve-fitting Page, or to the Interactive Statistics page or to the JCP Home Page

Send e-mail to John C. Pezzullo at statpages.org@gmail.com