Least squares approximation