Thread Closed

Curve-to-curve fitting trouble!

 
Share Thread Thread Tools
Jul31-08, 04:48 PM   #1
 

Curve-to-curve fitting trouble!


I'm currently working on a matlab program which, given two sets of data each representing curves, will transform (through rotations about the origin and x-y shifts) the first curve so it fits the second one best (so far in terms of sum of squares).

I have been able to create a program calculating vertical distance between the two curves, but because my curves double back on themselves I don't think this will really work.

Does anyone know how this might be done (in matlab or another language)? Or even just what this type of problem is called (I tried "Curve fitting", but this seems to only refer to point-to-curve fitting)

Thanks in advance,
Will
PhysOrg.com
PhysOrg
science news on PhysOrg.com

>> Galaxies fed by funnels of fuel
>> The better to see you with: Scientists build record-setting metamaterial flat lens
>> Google eyes emerging markets networks
Jul31-08, 08:24 PM   #2
 
Mentor
Is each set of data paired with the other or is there some parameterization that relates a given point on one curve with a unique point on the other?
Jul31-08, 08:48 PM   #3
 
The data is not paired, i.e. one set might be for x-values 10,20,30,40,50 and the other at 11,17,31.46,...etc
In the first version I used spline interpolation when I needed to compare points/curves.
(note these are not actually the data points!)
Thanks
Jul31-08, 09:24 PM   #4
 
Mentor

Curve-to-curve fitting trouble!


OK, if the data is not paired then this may be very slow depending on the size of your data. I think the operation I am going to suggest is O(N²).

For each data point A in the first set calculate the squared distance (x²+y²) with each data point B in the second set. The minimum distance is the distance of point A from set B. Sum that over all points in A to get a total distance measure. Minimize that distance measure.

By the way, this seems like it is a kind of registration problem, which is a type of optimization problem. There are probably people who have solved this much more efficiently than what I am suggesting.
Aug1-08, 12:13 AM   #5
 
Recognitions:
Science Advisor Science Advisor
Do the functions fit within some sort of boundary box or circle? It seems to me that what you want to minimize is the absolute area between the two curves; however, I'm not sure how well-defined that is.

Are the curves finite? If so, one could define the area by drawing lines between the endpoints of the curves. Still, I'm not sure exactly how to calculate the area in order to minimize it.
Aug3-08, 08:26 PM   #6
 
Thanks for the responses, I think I've solved it (partially) by rotating the parts of the curves so the don't double back on themselves. Works well so I'm happy with it!
Thread Closed

Tags
curve fitting, matlab, optimization
Thread Tools


Similar Threads for: Curve-to-curve fitting trouble!
Thread Forum Replies
Curve fitting in Matlab Math & Science Software 1
curve fitting General Physics 0
Curve Fitting Help Calculus 0
Curve Fitting Calculus 4