6. SLR Matrix Representation

Two Parameter Model

(y1y2yn)=(1x1x¯1x2x¯1xnx¯)X(β0β1)+(ε1ε2εn)minβYXβ,YXβ=minβY,Y2Y,Xβ+Xβ,Xβ=minβYTYYTXββTXTY+βTXTXβ

Derivative Theorems

Let u=aT and x=xTa where aT=(a1,a2,,ap) is a vector of constants

ux=(aTx)x=(xTa)x=a

If A is symmetric and u=xTAx where is is all constant

ux=(xTAx)x=2Ax

Least Squares Estimate

[yiβ0β1(xix¯)]2=(YXβ)T(YXβ)=YTYYTXTββTXTXβwant minβYTYYTXaTββTXTYa+βTXTXAβQβ=aa+2Aβ0=2XTY+2XTXβ(normal eq.)XTXβ=XTYβ^=(XTX)1XTYXTX=(111x1x¯x2x¯xnx¯)(1x1x¯1x2x¯1xnx¯)=(n(xix¯)(xix¯)(xix¯)2)=(n00Sxx)(XTX)1=(1n001Sxx)XTY=(111x1x¯x2x¯xnx¯)(y1y2yn)=(n(xix¯)(xix¯)(xix¯)2)=(yi(xix¯)yi)β^=(y¯(xix¯)yiSxx)

Properties:

Residuals and Hat Matrix
Y^=Xβ^=X(XTX)1XTHat Matrix:HY

ε^=YY^=YHY=(IH)Y

XTe^=XT(IH)Y=XTYXTHY=XTYXTY=0 orthogonal

Residual Sum of Squares and Hat Matrix
Let X have full rank r+1n. The least squares estimate of β in the Classical Linear Regression Model is given by:

β^=(XTX)1XTY

Let y^=Xβ^=Hy denote the fitted values of y, where

H=X(XTX)1XT

is called the "hat" matrix. Then the residuals

e^=yy^=[IX(XTX)1XT]y=(IH)y

satisfy XTe^=0 and y^Te^=0. Also, the

residual sum of squares is:

e^Te^=yT[IX(XTX)1XT]y=yTyyTXβ^

Hat Matrix

Y^=Xβ^=X(XTX)1XTHat Matrix:HY

Elements:

Hij=1n+(xix¯)(xjx¯)SXX

when i=j then we are calculating how much weight the observed value has in its own fitted value.

H=(1x1x¯1x2x¯1xnx¯)(n00Sxx)1(111x1x¯x2x¯xnx¯)=(1x1x¯1x2x¯1xnx¯)(1n001Sxx)(111x1x¯x2x¯xnx¯)=(1x1x¯1x2x¯1xnx¯)(1n1n1nx1x¯Sxxx2x¯Sxxxnx¯Sxx)

H22 Second row, second column

j=1nHij=1,i=1nHii=2=sum of leverages = num of parameters 

For SLR

For large sample sizes (>30) values 2 times the average leverage value should be considered large. For small sample sizes values 3 times the average leverage value should be considered large.

Testing Residuals

var(ε^i)=σ2(1Hii)

εi^ studentized=ε^MSE(1Hii)

approximately tn(p+1) where p is the number of parameters (+ slope)

εi^externally studentized (jackknifed)=ε^MSEi(1Hii)

where MSE is calculated without observation i
exactly tn(p+1)

RR={ε^such that |ε^|>tn2,α/2}