Least-squares approximation of an improper correlation matrix by a proper one