Least squares approximations