After you create a single fit, you can refine your fit, using any of the following optional steps:
Change fit type and settings. Select GUI settings to use the Curve Fitting app built-in fit types or create custom equations. For fit settings for each model type, see Linear and Nonlinear Regression, Interpolation, and Smoothing.
Exclude data by removing outliers in the Curve Fitting app. See Remove Outliers.
Select weights. See Data Selection.
Select validation data. See Select Validation Data
Create multiple fits and you can compare different fit types and settings side by side in the Curve Fitting app. See Creating Multiple Fits.
After you create a single fit, it can be useful to create multiple fits to compare. When you create multiple fits you can compare different fit types and settings side-by-side in the Curve Fitting app.
After creating a fit, you can add an additional fit using any of these methods:
Click the New Fit button next to your fit figure tabs in the Document Bar.
Right-click the Document Bar and select New Fit.
Select Fit > New Fit.
Each additional fit appears as a new tab in the Curve Fitting app and a new row in the Table of Fits. See Create Multiple Fits in Curve Fitting App for information about displaying and analyzing multiple fits.
Optionally, after you create an additional fit, you can copy
your data selections from a previous fit by selecting Fit > Use Data From >
Other Fit Name. This copies your selections for
z from the previous fit, and any selected validation
data. No fit options are changed.
Use sessions to save and reload your fits. See Save and Reload Sessions.
To create a copy of the current fit tab, select Fit > Duplicate
Fit Name". You also can right-click
a fit in the Table of Fits and select Duplicate
Each additional fit appears as a new tab in the Curve Fitting app.
Delete a fit from your session using one of these methods:
Select the fit tab display and select Fit > Delete
Select the fit in the Table of Fits and press Delete.
Right-click the fit in the table and select Delete
When you have created multiple fits you can compare different fit types and settings side by side in the Curve Fitting app. You can view plots simultaneously and you can examine the goodness-of-fit statistics to compare your fits. This section describes how to compare multiple fits.
To compare plots and see multiple fits simultaneously, use the layout controls at the top right of the Curve Fitting app. Alternatively, you can click Window on the menu bar to select the number and position of tiles you want to display. A fit figure displays the fit settings, results pane and plots for a single fit. The following example shows two fit figures displayed side by side. You can see multiple fits in the session listed in the Table of Fits.
You can close fit figures displays (with the Close button, Fit menu, or context menu), but they remain in your session. The Table of Fits displays all your fits (open and closed). Double-click a fit in the Table of Fits to open (or focus if already open) the fit figure. To remove a fit, see Deleting a Fit.
If you want more space to view and compare plots, as shown next, use the View menu to hide or show the Fit Settings, Fit Results, or Table of Fits panes.
You can dock and undock individual fits and navigate between them using the standard MATLAB® Desktop and Window menus in the Curve Fitting app. For more information, see Optimize Desktop Layout (MATLAB).
The Table of Fits list pane shows all fits in the current session.
After using graphical methods to evaluate the goodness of fit, you can examine the goodness-of-fit statistics shown in the table to compare your fits. The goodness-of-fit statistics help you determine how well the model fits the data. Click the table column headers to sort by statistics, name, fit type, and so on.
The following guidelines help you use the statistics to determine the best fit:
SSE is the sum of squares due to error of the fit. A value closer to zero indicates a fit that is more useful for prediction.
R-square is the square of the correlation between the response values and the predicted response values. A value closer to 1 indicates that a greater proportion of variance is accounted for by the model.
DFE is the degree of freedom in the error.
Adj R-sq is the degrees of freedom adjusted R-square. A value closer to 1 indicates a better fit.
RMSE is the root mean squared error or standard error. A value closer to 0 indicates a fit that is more useful for prediction.
# Coeff is the number of coefficients in the model. When you have several fits with similar goodness-of-fit statistics, look for the smallest number of coefficients to help decide which fit is best. You must trade off the number of coefficients against the goodness of fit indicated by the statistics to avoid overfitting.
For a more detailed explanation of the Curve Fitting Toolbox™ statistics, see Goodness-of-Fit Statistics.
To compare the statistics for different fits and decide which fit is the best tradeoff between over- and under-fitting, use a similar process to that described in Compare Fits in Curve Fitting App.