Statistics Toolbox | ![]() ![]() |
The polytool
demo is an interactive graphic environment for polynomial curve fitting and prediction.
The polytool
demo has the following features:
You can use polytool
to do curve fitting and prediction for any set of x-y data, but, for the sake of demonstration, the Statistics Toolbox provides a data set (polydata.mat
) to teach some basic concepts.
To start the demonstration, you must first load the data set.
The variables x and y are observations made with error from a cubic polynomial. The variables x1
and y1
are data points from the "true" function without error.
If you do not specify the degree of the polynomial, polytool
does a linear fit to the data.
The linear fit is not very good. The bulk of the data with x-values between zero and two has a steeper slope than the fitted line. The two points to the right are dragging down the estimate of the slope.
In the Degree box at the top, type 3
for a cubic model. Then, drag the vertical reference line to the x-value of 2 (or type 2
in the X Values text box).
This graph shows a much better fit to the data. The confidence bounds are closer together indicating that there is less uncertainty in prediction. The data at both ends of the plot tracks the fitted curve.
The following sections explore additional aspects of the tool:
![]() | The disttool Demo | Confidence Bounds | ![]() |