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.8065xWe 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^20 2 4 6 8 10 120.811.21.41.61.822.22.42.6xyFigUre 13.3 Scatterplot of Sample Data and Plot of the Best Fitting Straight Line