Model Estimation 271
function. With the function polyfit (X,Y,1) we obtain the following solution:
a = 0.1317, b = 0.8065. Figure 13.3 represents the scatterplot of data and
the best fitting straight line
y = 0.1317 + 0.8065x
We can measure how accurately the straight line represents the sample
data with the square root of sum of squared residuals, which is the sum
S evaluated for a = 0.1317, b = 0.8065. For our sample data, we obtain
S= 0. 6566.
Looking at the scatterplot of sample data shown in Figure 13.3, we
might ask if a polynomial of second degree could better approximate the
data. We can repeat the above process but using
ya=+bx+cx^2
0 2 4 6 8 10 12
0.8
1
1.2
1.4
1.6
1.8
2
2.2
2.4
2.6
x
y
FigUre 13.3 Scatterplot of Sample Data and Plot of the Best Fitting Straight Line