The K Desktop Environment

5.17. Autofit settings

The dialog Autofit settings is used to perform the settings for automatic parameter fits of functions to data sets, which are combined with the autoplot feature when the option Autofit is activated in the Autoplot settings dialog.

In the Library field in the group y(x) the path of the shared library containing the function to be fitted may be entered. The button right to the entry field opens a file selection dialog for this purpose.

The name of the Function is entered in another field. When in the same directory as for the shared library a module definition file with the same name but the extension .def is present, the function may be chosen from a list in the dialog Functions, opened with the button right to the entry field.

With the button Edit a dialog Parameter may be opened, which allows to enter the values of up to 20 initial parameters of the function. Also the parameters which should be fitted and not kept constant may be selected by checkboxes. When the option Show Function Source is activated in the Settings menu and a C or C++ language source file with the same name as the shared library but the extension .c or .cpp, respectively, is present in the same directory, its contents is displayed right to the parameter fields, too. The button Load opens a file selection dialog for loading the parameters from an ASCII file (one parameter each line). The button Save opens a file selection dialog for saving the parameters in an ASCII file.

When the box Nonlinear fit is checked, nonlinear parameter fits by employing the iterative Levenberg-Marquardt method will be performed. Otherwise noniterative general linear least square parameter fits are selected. In this case the function must depend linearly on all parameters chosen to be fitted.

When the box Error column is checked, the corresponding column of the data set, selected in the dialog Array, will be used as the standard deviation of the y values for calculation of chi-square. Otherwise the standard deviation will be estimated by an error model function taking the y value as its argument. This function and their parameters may be selected in a dialog which is displayed by clicking Model. A simple error model might be selected by choosing a polynomial with p1 = 0.01, resulting in standard deviations of 1 %.

Termination of the iterative nonlinear parameter fit algorithm may be controlled by setting a Maximum iterations number and a Tolerance value. Fitting will be terminated when either the maximum number of iterations is reached or the relative errors of chi-square or of the parameters have decreased down to the tolerance value.

Markers (Symbol <= 0) or lines (Symbol > 0) may be chosen to present the fitted function. This is done most convenient using the dialog Lines and Markers, to be opened with the button right to the spin box, which shows the actual line or marker.

The Color of lines or markers may be chosen using the dialog Select Color, opened with the colored button.

When Show dialog is active, the dialog Parameter fit is shown when performing the fit, allowing monitoring and interaction.

The resulting parameter settings will be saved automatically on disk, when the option Save parameters is active. The filename is derived from the name of the data file. The extension is set to .par.

When Follow parameters is active, the set of initial parameters will not be reset before starting a fit to the next data set of a series of data files.

The dialog may be canceled without saving by use of the button Cancel. With OK changes are saved and the dialog is closed.