Beruflich Dokumente
Kultur Dokumente
Steve McFaul
asdf
(1)
Math 410
Steve McFaul
asdf
ei yi b0 b1 xi
SSE ( yi b0 b1 xi ) 2
(4)
where n = the sample size for the data. It is this expression that
we actually need to differentiate with respect to b0 and b1. Lets
start by taking the partial derivative of SSE with respect to the
regression constant, b0, i.e.,
SSE
b0
b0
(y
1
b0 b1 x1 ) 2
SSE
( yi b0 b1 x1 ) 2
b0
1 b0
Math 410
Steve McFaul
asdf
(5)
For the time being, lets put this result aside and take the partial
derivative of SSE
with respect to the regression coefficient, b1, i.e.,
SSE
b1
b1
(y
1
b0 b1 x1 ) 2
SSE
( yi b0 b1 x1 ) 2
b1
1 b10
(6)
3 | Page
Math 410
Steve McFaul
asdf
0 2 ( yi b0 b1 x1 )
(7)
0 2 xi ( yi b0 b1 x1 )
(8)
0 ( yi b0 b1 x1 )
1
0 yi b0 b1 x1
b0 yi b1 x1
Since b0 and b1 the same for all cases in the original OLS equation,
this further simplifies to:
n
nb0 yi b1 x1
b0
4 | Page
b1
x
1
(9)
Math 410
Steve McFaul
asdf
Equation (9) will come in handy later on, so keep it in mind. Right
now, though, it is important to note that the first term on the right
of Equation (9) is simply the mean of yi, while everything
following b1 in the second term on the right is the mean of xi.
(10)
b0 y b1 x
Now, we need to solve Equation (8) for b1. Again, we get rid of the
-2 by multiplying each side of the equation by -1/2:
n
0 xi ( yi b0 b1 x1 )
1
0 xi yi xi b0 b1 xi2 )
1
0 xi yi xi b0 b1 xi2
Next, we bring all of the constants in these terms (i.e., b0 and b1)
out in front of the summation operators, as follows:
n
0 xi yi b0 xi b1 xi2
We then add the last term on the right side of the equation to
both sides:
n
b1 xi2 xi yi b0 xi
5 | Page
Math 410
Steve McFaul
asdf
b1 xi2 xi yi
b1
xi
b1 xi2
1
y i xi
xi y i
b1
xi
If we then add the last term on the right to both sides of the
equation, we get:
n
b1 xi2 b1
xi y i
y x
i
On the left side of the equation, we can then factor out b1:
b1
xi2
xi y i
y x
i
b1
x y
i
6 | Page
y i xi
x
2
i
x
i
Math 410
Steve McFaul
asdf
Finally, if we multiply top and bottom by n we obtain the leastsquare estimator for the regression coefficient in the bivariate
case. This is the form from lecture:
n
b1
n xi y i y i xi
1
n x
1
2
i
(11)
(12)
7 | Page
(13)
Math 410
Steve McFaul
asdf
If you work out the matrix operations for the expression on the
right, youll notice that the result is a scalar a single number
consisting of the sum of the squared errors of prediction (i.e.,
multiplying a 1N matrix by a N1 matrix produces a 11 matrix,
i.e., a scalar). In order to take the derivative of the quantity with
regard to the B matrix, we first of all need to express e in terms
of Y, X, and B:
e = Y XB
Now, if multiplied out, the two middle terms YXB and BXY are
identical: they produce the same scalar value. As such, the
equation can be further simplified to:
SSE = YY 2YXB + BXXB
(14)
Math 410
Steve McFaul
asdf
(15)
The next step is to set this partial derivative to zero and solve for
the matrix B.
This will give us an expression for the matrix of estimates that
minimize the sum
of the squared errors of prediction. We start with the following:
0 = 2XY + 2XXB
-1
9 | Page
XY
(16)
Math 410
Steve McFaul
asdf
10 | P a g e