202405181945
Status: #idea
Tags: Multiple Linear Regression

The Method Of Least Squares in Multiple Linear Regression

Pasted image 20240606151018.png

The logic is identical to the Simple Linear Regression case, except that we now need to represent everything in matrix form.

This changes the formulas since now we need to find our estimators using tensor calculus and stuff, but if you understand the logic in the single-variate case, doing it for multiple variables is just deriving the formulas using matrices all over again.

I will not bother going through the derivation mainly because I got a textbook that does it already, so I will just paste the formulas.

The Importance of SSres(i=1nei)

Pretty much all the formulas below are derived through some representation of the sum of error which we're trying to minimize. It is good to familiarize oneself with the ways to do so.

Formulas

β^=

Pasted image 20240518200034.png

SSres=SSError=i=inei2=i=in(YiY^i)2= Pasted image 20240518195411.png

From the equation for β^ and SSres we can simplify the equation for SSres to
Pasted image 20240518201001.png

The degree of freedoms of SSres in the multiple linear regression case is nk where k is the number of parameters. This is nothing more than a generalization of the Simple Linear Regression which had n2 degree of freedoms since we needed 2 error terms to be fixed to satisfy the normal equations.

Therefore we can compute the MSres as
Pasted image 20240518201404.png
The image above tells us that SSres is distributed according to a χ2 with nk degrees of freedom.

SStotal=i=1n(YiY¯)2=

Pasted image 20240518201936.png
First SST has n1 degree of freedoms.

In matrix form this is written as:

SST=YTYnY¯2

Where Y¯ is a scalar quantity.

Since we have a formula for SSres and a formula for SST through the relation SST=SSres+SSreg we can derive that:

SSreg=i=1n(Y^iY¯)2=

Pasted image 20240518202222.png

SSreg has how many degree of freedoms?

Recall that DFtotal=DFreg+DFres, since we know that DFtotal is n1 and that DFres is nk where k is the number of parameters, it follows that n1(nk) or in a civilized world k1 will be the number of degrees of freedom of SSreg.

Therefore MSreg is:

MSreg=SSregk1

The Method Of Least Squares In Simple Linear Regression
Video on Multiple Linear Regression