Least-squares approximation