make the negative ones become positive. That way, they can’t possibly produce any spurious cancellations. (Here’s one place where the fact that a negative times a negative is a positive is useful in a practical setting. It makes the square of a negative error count as a positive discrepancy, as it should.) So the basic idea is to choose the four parameters in the sine wave in such a way that they minimize the total squared error of the fit to the data. Accordingly, this approach is called the method of least squares. It works best when the data follow a pattern, as they do here.