#### 3.25.21 fit

The fit command controls the options for the fit command.

Syntax:

          set fit {logfile {"<filename>"}}
                  {{no}quiet}
                  {{no}errorvariables}
                  {{no}prescale}
          unset fit
          show fit

The <filename> argument must be enclosed in single or double quotes.

If no filename is given or fit is used the log file is reset to its default value "fit.log" or the value of the environmental variable ‘FIT_LOG‘.

If the given logfile name ends with a / or \, it is interpreted to be a directory name, and the actual filename will be "fit.log" in that directory.

If the ‘errorvariables‘ option is turned on, the error of each fitted parameter computed by fit will be copied to a user-defined variable whose name is formed by appending "_err" to the name of the parameter itself. This is useful mainly to put the parameter and its error onto a plot of the data and the fitted function, for reference, as in:

           set fit errorvariables
           fit f(x) 'datafile' using 1:2 via a, b
           print "error of a is:", a_err
           set label 'a=%6.2f', a, '+/- %6.2f', a_err
           plot 'datafile' using 1:2, f(x)

If the ‘prescale‘ option is turned on, parameters are prescaled by their initial values before being passed to the Marquardt-Levenberg routine. This helps tremendously if there are parameters that differ in size by many orders of magnitude. Fit parameters with an initial value of exactly zero are never prescaled.

By default the information written to the log file is also echoed to the terminal session. ‘set fit quiet‘ turns off the echo.