Least Squares Problem with Summation

$$\sum_{j=1}^m |y_j-y(x_j)|^2$$

1) Set up the matrix equation for the least-squares problem. I am getting and m by 1 matrix but I think I should be getting a 2 by 2 matrix.

2) Convert this matrix equation into the normal equation. In particular, use norm notation and dot product notation to write $$A^TA$$ and $$A^Tb$$ compactly.

3) Solve this system by inverting the 2x2 matrix and applying it to the right-hand side vector and identify the assumption needed for this solution to exist.

• I know that I could just brute force the first part of the problem with partial derivatives but then I do not feel like I am learning anything. – mattsprestige Sep 21 '19 at 15:50