Standard Library function that performs anonlinear least-squares fit to a function of an arbitrary number of parameters.
y
wt
parms
If parms is supplied as a double-precision variable, the calculations are performed in double-precision accuracy. Otherwise, the calculations are performed in single-precision accuracy.
sigma
The initial estimates of parms should be as close to the actual values as possible or the solution may not converge. CURVEFIT performs iterations of the fitting function until the chi-squared value for the goodness of fit changes by less than 0.1 percent, or until 20 iterations are reached.
TIP: These initial estimates for parms can be calculated from the result of the POLY_FIT function when it is used to fit a straight line through data.
CURVEFIT is modified from the program CURFIT found in Data Reduction and Error Analysis for the Physical Sciences, by Philip Bevington, McGraw-Hill, New York, 1969. It combines a gradient search with an analytical solution developed from linearizing the fitting function. This method is termed a "gradient-expansion algorithm."
wt can have any value, as long as its size is correct. Some possible ways to weight a curve are suggested below (where i is an index into y, the vector of Y values):
TIP: In most cases, you would use a different weighting factor for each scale or instrument that was used to measure your original data.
gaussfit.pro
file in the Standard Library.