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. All of which raises an extremely