Computes closed-form solution to linear regression