Appendix B
Least Squares Geometry
Contents
This appendix describes two geometric aspects of ordinary least squares estimation that explain how
it applies to fitting a general linear model. The first is the orthogonality of the model prediction (
Oy
)
and its residual (y Oy). The second is the way in which the hat matrix P acts a projection matrix.
Orthogonality of Predictions and Residuals
The ordinary least squares estimator
O
ˇ
OLS
minimizes the squared distance
ky Xˇ k
2
2
D . y Xˇ /
0
. y Xˇ /
where
y
is the response vector
.y
1
;y
2
;:::;y
n
/
0
,
X D Œ1x
1
x
p
is the model matrix, and
ˇ D