The fit command can fit a user-defined function to a set of data points
(x,y,z), using an implementation of the nonlinear least-squares (NLLS) Marquardt-Levenberg algorithm.
Any user-defined variable occurring in the function body may serve as a fit parameter, but the return type of the function must be real.
|Fitting parameters ||Use letters to represent parameters that will be used to fit a function. E.g.: |
|File parameters ||Instead using uninitialised parameters (the Marquardt-Levenberg will automatically initialise for you |
fitis used to find a set of parameters that ’best’ fits your data to your user-defined function. The fit is judged on the basis of the sum of the squared differences or ’residuals’ (SSR) between the input data points and the function values, evaluated at the same places. This quantity is often called ’chisquare’ (i.e., the Greek letter chi, to the power of 2). The algorithm attempts to minimize SSR, or more precisely, WSSR, as the residuals are ’weighted’ by the input data errors (or 1.0) before being squared. (Ibidem)
After each iteration step a detailed info is given about the fit's state both on the screen and on a so-called log-file
fit.log. This file will never be erased but always appended so that the fit's history isn't lost.