1

I am doing multiple linear regression. I was directed to this question on how to solve MLR as a sequence of simple linear regressions, Question on how to normalize regression coefficient and I understand this result.

However I have also been told that Moore-Penrose Pseudo Inverse can be used for MLR. In doing so I see that it does indeed give the least squares result for a set of linear equations. However I can't figure out how to use it for linear regression if I have a y intercept that is non-zero.

The Moore-Penrose Equation that I understand, which is ( (A' * A)^-1 * A' ) * y seems to force a regression through the origin. Is there a way to use it and then calculate an intercept ?

Fairly Nerdy
  • 877
  • 1
  • 8
  • 16

1 Answers1

3

The intercept term can be viewed as the coefficient of an independent variable that is always one. Therefore, adding a column of ones to the matrix $A$ will result in the intercept term surfacing at the corresponding position.

cangrejo
  • 2,121
  • 13
  • 22