Dot product and linear regression

I'm studying PCA and my professor said something about finding the linear regression by doing the dot product of both axis. Could someone explain to me why? The dot product returns a number. What's the relationship between that number and the linear regression?

In my example, I have two vectors

$$stat\_grade = [0,1,3,7,10]$$

$$physics\_grade = [1,5,8,10,10]$$

The first step is normalizing them:

$$\frac{stat\_grade - mean(stat\_grade)}{std(stat\_grade)} = [-1.69131435 -0.52489066 0.34992711 0.93313895 0.93313895]$$

$$\frac{physics\_grade - mean(physics\_grade)}{std(physics\_grade)} = [-1.11613741 -0.85039041 -0.3188964 0.7440916 1.54133261]$$

Computing the dot product between the normalized vectors will return $$4.355129045906131$$

I can't understand how a single number can help me to find the linear regression

Thanks for the response!

• dot product of normalised vectors gives the cosine of the angle one has with the other, thus gives the linear factor in a linear model of one as function of the other Jan 24, 2021 at 17:19
• en.wikipedia.org/wiki/… Jan 24, 2021 at 17:27
• Therefore the dot product gives the slope of the line? Jan 24, 2021 at 17:30
• yes, exactly, gave referencve for simple case, to see it better Jan 24, 2021 at 17:31
• I got it but i will need to find the y intercpet to plot the line right? Jan 24, 2021 at 17:52

$\inline&space;\dpi{120}&space;\large&space;y&space;=&space;\beta_0x_0&space;+&space;\beta_1x_1&space;\newline&space;\hat{\beta}&space;=&space;(X^T.X)^{-1}X^T.Y$