15.2. Least squares method