Hello Ali,
As Frank says, the square sum of differences is an error function expressing the "distance" between any two curves. Or equivalently, the Norm of the difference in the y-values, where the y-values of a curve are treated as a vector representing the curve, and the norm of the difference is a metric.
Of course, this only works directly if each curve has the same set of x-values. However, if that is not the case, the data set can be resampled within a domain which is common to all the curves, and then the method applied to the resampled data.
The attached notebook illustrates this with some made-up data. It is a bit verbose. Most of it could be compressed into a few lines of dense code. But then it would look like chickens had been pecking on the keyboard.
Kind regards,
David
Attachments: