This calculates the least squares solution of the equation AX=B by solving the normal equation A^{T}AX = A^{T}B. Note: this method requires that A not have any redundant rows.