Curve-to-curve fitting trouble

  • Thread starter villiami
  • Start date
  • Tags
    Fitting
In summary, the programmer is trying to find a way to transform one curve to fit another best. The first curve is represented by data points, and the second curve is represented by points that are paired with the first. The programmer has tried spline interpolation, but it seems to be slow. The programmer has found a way to rotate the curves so that they don't double back on themselves. This seems to work well, and the programmer is happy with the solution.
  • #1
villiami
27
0
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
 
Technology news on Phys.org
  • #2
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?
 
  • #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
 
  • #4
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.
 
  • #5
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.
 
  • #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!
 

1. What is curve-to-curve fitting trouble?

Curve-to-curve fitting trouble refers to difficulties encountered when trying to find the best mathematical curve that fits a set of data points. It can occur when the data points do not follow a clear pattern or when there are outliers that skew the curve.

2. How do I know if I am experiencing curve-to-curve fitting trouble?

If you are having trouble finding a curve that accurately represents your data points, or if the resulting curve does not fit the data well, you may be experiencing curve-to-curve fitting trouble. Additionally, if the curve does not adequately explain the relationship between the variables in your data, it may be a sign of trouble.

3. What are some common causes of curve-to-curve fitting trouble?

Curve-to-curve fitting trouble can be caused by a variety of factors, including poorly collected or incomplete data, a limited number of data points, or a non-linear relationship between the variables. It can also be caused by using an inappropriate curve-fitting method or not considering the underlying assumptions of the chosen method.

4. How can I overcome curve-to-curve fitting trouble?

There are several strategies that can help overcome curve-to-curve fitting trouble. These include collecting more data points, removing outliers, trying different curve-fitting methods, and considering the underlying assumptions of the chosen method. It may also be helpful to consult with a statistician or seek feedback from colleagues.

5. Is there a way to prevent curve-to-curve fitting trouble?

While it is not always possible to prevent curve-to-curve fitting trouble, there are steps that can be taken to minimize the likelihood of encountering it. These include carefully collecting and organizing data, choosing an appropriate curve-fitting method, and being aware of and addressing potential sources of bias. It is also important to thoroughly understand the data and the relationship between the variables before attempting to fit a curve.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
  • Programming and Computer Science
Replies
9
Views
2K
  • Precalculus Mathematics Homework Help
Replies
7
Views
1K
  • Introductory Physics Homework Help
Replies
8
Views
1K
  • General Math
Replies
7
Views
1K
  • Calculus and Beyond Homework Help
Replies
6
Views
603
  • Astronomy and Astrophysics
Replies
1
Views
1K
  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
4
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
953
Back
Top