Maybe I should ask this in Mathoverflow but here it goes:
I have 2 data sets (sets of x and y coordinates) with different number of elements. I have to find the best match between them by stretching one of the data sets (multiplying all x with a factor of m and all y with a factor of n) and moving it around (adding p and q to all x and y respectively).
Basically these 2 sets represent different curves and i have to fit curve B (which has less elements) to some segment of curve A (which has many more elements).
How can I find the values m, n, p, and q for the closest match?
Answers can be pseudo code, C, Java or Python. Thanks.
m = n = 0
and then add the first data point from A as offset p,q. Or you can make a horizontal line, by multiply only Y bym = 0
and search for the flattest segment in A.