270 The Basics of financial economeTrics
points on the line. In this case, the sum for a generic a and b can be writ-
ten as:
()()()
()()()
()()
()()
= −−× + −−× + −−×
+ −−× + −−× + −−×
+ −−× + −−×
+ −−× + −−×
S.ab .ab.ab
.ab.ab .ab
.ab.ab
.ab.ab
07 0.81 31 .8 11 2.9
17 4.21 65 .5 14 6.7
16 7.41 78 .1
21 9.22 4 10.6
222
222
22
22
It is possible to find the value that minimizes the above expression ana-
lytically by equating to zero the partial derivatives of S:
∂
∂
=
∂
∂
=
S
a
S
b
00
However, commercial econometric software uses iterative programs
that find the minimum of S by an iterative searching procedure. For
example, we can perform the above operation in MATLAB using the polyfit
0 2 4 6 8 10 12
0
0.5
1
1.5
2
2.5
x
y
FigUre 13.2 Scatterplot of Sample Data and the Plot of the Straight Line
y = 0.05 + 0.1x