What is the simplest curve that fits this data?

In summary, the conversation discusses finding a simple curve to fit a set of data points that relate the width of an object in an image to its distance from the camera. The group suggests using a hyperbola as the best fit and mentions using log-log plots to determine the equation. They also mention using known physical relationships to find a functional relationship. Ultimately, a power function is determined as the best fit equation.
  • #1
gnome
1,041
1
I have a set of data points relating the width of an object in an image to its distance from the camera. I'd like to find the simplest curve that fits "pretty well". When I graph the points, it looks like a hyperbola would be a good fit. Is there a simple iterative method to find an equation?

The data:
(20, 59)
(30, 44)
(40, 34)
(50, 28)
(60, 24)
(70, 21)
(80, 19)
(90, 17)
(100, 15)
(125, 12)
(150, 10)
(175, 9)
(200, 8)
(225, 7)
(250, 6)
I suppose I could add (0,infinity) to that list. Nothing above x=250 is relevant.
 
Mathematics news on Phys.org
  • #2
There is no way to generate the functional relationship. You need to "guess" a relationship then attempt to find the characteristic parameters.
 
  • #3
gnome said:
I have a set of data points relating the width of an object in an image to its distance from the camera. I'd like to find the simplest curve that fits "pretty well". When I graph the points, it looks like a hyperbola would be a good fit. Is there a simple iterative method to find an equation?

Yes theoretically it should be a hyperbola. So take the reciprocal of the second data column and then it should be a straight line.
 
  • #4
log log plots. as were taught decades ago, but seemingly not anymore...
 
  • #5
Thanks, uart, that was very helpful.

Matt: I'll put that on my to-do list. ;)
 
  • #6
It's quite a simple device, really.If you believe that data x_i and y_i are related by something like x^n=k*y^m, then taking logs nlog(x)=log(k)+mlog(y), i.e. their logs should form a straight line graph. You can also try variations if you thought that y^n=k*exp(x), or something similar. You used to be able to buy log-log graph paper to do this. So I'm told - I'm too young to have used this.
 
  • #7
I quite like [itex]y = 957.83 x^{-0.9057}[/itex] thank you very much :)
 
  • #8
Gib Z said:
I quite like [itex]y = 957.83 x^{-0.9057}[/itex] thank you very much :)
Or

[tex]y = \frac{1000}{0.63 x + 3.65}[/tex]

It depends on what model you choose to fit.
 
  • #9
If you wanted something of physical interest you would attempt to find a f such that:

[tex] \frac 1 x + \frac 1 y = \frac 1 f [/tex]

I would guess this relationship since I know about the thin lens formula. That is the trouble with simply fitting data with no thought of the known physical relationships. You can get perfectly good fits which have no physical meaning.
 
  • #10
matt grime said:
log log plots. as were taught decades ago, but seemingly not anymore...

Actually we just did them in my physics I high school course to show Kepler's 3rd using the orbital radius and period of the planets :rofl:

But yeah the slope of the log-log graph is the power of the function.

Edit: I got:
[tex]y=\frac{957.83}{x^{.90499}}[/tex]
 
Last edited:

1. What is the purpose of fitting a curve to data?

Fitting a curve to data is a statistical method used to determine the relationship between two variables and to create a mathematical model that best represents the data. This allows scientists to make predictions and draw conclusions about the data.

2. What types of curves can be used to fit data?

There are several types of curves that can be used to fit data, including linear, polynomial, exponential, and logarithmic curves. The choice of curve depends on the type of relationship between the variables being studied.

3. How is a curve fitted to data?

A curve is fitted to data by using a mathematical algorithm to find the best-fit line or curve that minimizes the distance between the data points and the curve. This is typically done using statistical software or programming languages such as Python or R.

4. What is the importance of evaluating the fit of a curve to data?

Evaluating the fit of a curve to data is important because it allows scientists to determine how well the curve represents the data. This can help identify any outliers or errors in the data, and determine the accuracy and reliability of the mathematical model.

5. Can a curve be fitted to any type of data?

A curve can be fitted to most types of data, as long as there is a relationship between the variables being studied. However, it is important to note that some types of data may require more complex or specialized curve fitting methods, and not all data can be accurately represented by a curve.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • Advanced Physics Homework Help
Replies
11
Views
1K
  • Calculus and Beyond Homework Help
Replies
9
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
Replies
3
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
8K
  • General Discussion
Replies
18
Views
11K
  • Precalculus Mathematics Homework Help
Replies
4
Views
785
  • General Discussion
Replies
9
Views
2K
Back
Top