The Fit Wizard

This dialog is activated by selecting the command Fit Wizard... from the Analysis Menu. This command is active if a plot or a table window is selected. In the latter case, this command first creates a new plot window using the list of selected columns in the table.

This dialog is used to fit discrete data points with a mathematical function. The fitting is done by minimizing the least square difference between the data points and the Y values of the function.

The top of the dialog box is used to choose a function among the one which are already define. Four types of functions are availables: the user defined functions which have been saved, the classical functions proposed by QtiPlot in the analysis menu, the simple elementary built-in functions, and external functions via pluggins.

To choose one of these functions, you just have to select it and to click on the checkbox under the selector.

If you want to define your own function, you can use the bottom half of the dialog box. You can write you own mathematical expression or add expressions obtained with the function selector.

Figure 5-44. The first step of the Fit Wizard... dialog box.

This first step is used to define the function which will be used for the fitting

The second step is to define the parameters for the fit. You have to give initial guess for the fitting parameters.

Figure 5-45. The second step of the Fit Wizard... dialog box.

This second step is used to define the parameters of the fitting

In this second tab you can also choose a weighting method for your fit (the default is No weighting). The available weighting methods are:

  1. No weight: all weighting coeficients are set to 1 (wi = 1).

  2. Instrumental: the values of the associated error bars are used as weighting coeficients wi = 1/eri2, where eri are the error bar sizes stored in error bar columns. You must add Y-error bars to the analysed curve before performing the fit.

  3. Statistical: the weighting coeficients are calculated as wi = 1/yi, where yi are the y values in the fitted data set.

  4. Arbitrary Dataset: you have the possibility to set the weighting coeficients using an arbitrary data set wi = 1/ci2, where ci are the values in the arbitrary data set. The column used for the weighting must have a number of rows equal to the number of points in the fitted curve.

  5. Direct Weighting: you have the possibility to set the weighting coeficients using an arbitrary data set wi = ci, where ci are the values in the arbitrary data set. The column used for the weighting must have a number of rows equal to the number of points in the fitted curve.

After the fit, the log window is opened to show the results of the fitting process.

Depending on the settings in the Custom Output tab, a function curve (option Uniform X Function) or a new table (if you choose the option Same X as Fitting Data) will be created for each fit. The new table includes all the X and Y values used to compute and to plot the fitted function and is hidden by default, but it can be found and viewed with the project explorer.

Figure 5-46. The third step of the Fit Wizard... dialog box.

This third step is used to customize the output of a fitting operation.

This dialog tab provides controls that can be used to evaluate the goodness of fit. The first one is the Residuals Plot button which can be used to display the curve of the plot residuals. The Conf. Bands and Pred. Bands buttons can be used to generate confidence and prediction limits for the current fit, based on the user input confidence value.

After the fit, a series of fit statistics are displayed in the log window allowing to evaluate the goodness of fit. This values are:

  1. Chi^2/doF
  2. R-square
  3. Adjusted R-square
  4. RMSE (Root Mean Squared Error)
  5. RSS (Residual Sum of Squares)
For detailed explanations about the meaning of this statistical values, please visit the following link.

By default, the reported errors are not automatically scaled with the square root of the reduced chi-squared value. You can choose to enable this option by checking the Scale errors with sqrt(Chi^2/doF) box.