Computes the closed-form solution to linear regression using the normal equations.