Find a curve that fits this data please

  • Thread starter johnpjust
  • Start date
  • Tags
    Curve Data
In summary, the researcher is looking for a general curve fit that has the format of f(x)/x to help with future predictions. The stipulations for the fit curve include being positive for 'x' > 0, behaving well at zero, and using as few parameters as possible. The researcher has tried examples such as sqrt(x)/x and log(x)/x, but has not found a suitable curve that "bends" in the way that fits the data best. The conversation also discusses using y*x as a function of x to create a linear fit and adding an exponential term to better fit the data points for low values of 'x'. Overall, the researcher is impressed with the fit and thanks the expert for their help.
  • #1
johnpjust
22
0
I'm doing research and I have some data (attached -- 'y' = first column, 'x' = second column in CSV format) that I need to find a general curve fit for (function = f(x)/x). This will help me do future predictions.

Here are my stipulations:

The fit curve must have the format of f(x)/x. Two examples I've tried are sqrt(x)/x and log(x)/x --> and of course they have more general forms such as [(b*x+a)^n]/x and {[log(x+a)]^n}/x. However, these functions do not "bend" in the way that fits the data best so there must be better (see "sqrt.jpg").

The function f(x) MUST behave well at zero and be positive for 'x' > 0. E.g., for the log function this can be done by shifting the x data by '1'. The sqrt function is naturally well behaved with no modifications obviously.

The curve needs to fit the general shape but use as FEW of parameters as possible. E.g., the sqrt function (x^n) is attractive because it only uses 1 parameter, "n", but just not quite right.

Thanks!
 

Attachments

  • fitThisData.txt
    4 KB · Views: 783
  • sqrt.jpg
    sqrt.jpg
    18.3 KB · Views: 488
Last edited:
Mathematics news on Phys.org
  • #2
If you want an x in the denominator, it is easier to look at y*x as function of x. There, a linear fit is actually reasonable, especially if we can ignore the first datapoint (at x=9.5) as outlier.

It is easy to adjust that shape to fit better to the lower values, for example with f(x)=0.255 x + 19 - 19 e^(-0.1x). I did not optimize it yet (and I'm not used to measured values without known uncertainties), that's just by eye. But that arbitrary exponential there looks like overfitting, at least without a physical model behind it.

Here are y*x and y as a function of x, with f(x) plotted on top:

attachment.php?attachmentid=69110&stc=1&d=1398527083.png
 

Attachments

  • fitproblem.png
    fitproblem.png
    8.7 KB · Views: 503
  • Like
Likes 1 person
  • #3
Very impressive! You must do this often to be able to "eye" a fit?! Can you explain a little more (maybe in a different way) on what you've done here? I don't quite understand "y*x as function of x".

This is a model to describe relative changes in bulk density of a material, so no physical model is really possible. The variability in the data is due to measurement error and other factors but very difficult to isolate.

Also - The curve would need to bend up a little more in the beginning. After you've linearized the data in the top graph, the group at the beginning is slightly bias.

Thanks!
 
  • #4
Very impressive! You must do this often to be able to "eye" a fit?! Can you explain a little more (maybe in a different way) on what you've done here? I don't quite understand "y*x as function of x".
I multiplied all y-values with their x-values. That way my new data points get the same shape as the (unknown) f(x). Then I tried a linear fit. It was reasonable, but not good in the region of low x, so I used those fit parameters and added the exponential.

Also - The curve would need to bend up a little more in the beginning. After you've linearized the data in the top graph, the group at the beginning is slightly bias.
What do you mean?
 
  • #5
For the low values of 'x', the fit curve you've given APPEARS to generally be "under" the data points. Is there a way to manipulate the curve to better fit the data points for low low values of 'x'?
 
  • #6
Sure, just play around with the 4 free parameters.
 
  • #7
Cool. Well done, and thank you.
 

1. What is the purpose of finding a curve that fits data?

The purpose of finding a curve that fits data is to create a mathematical representation of the relationship between variables in a dataset. This allows for easier interpretation and prediction of future data points.

2. How do you determine which curve best fits the data?

There are various methods for determining which curve best fits the data, including linear regression, polynomial regression, and exponential regression. The best fit curve is determined by minimizing the distance between the actual data points and the predicted values on the curve.

3. Can you use any type of curve to fit the data?

No, not all curves are suitable for fitting data. The type of curve used depends on the nature of the data and the relationship between the variables. For example, linear regression is suitable for data with a linear relationship, while exponential regression is better for data that follows an exponential pattern.

4. What are the limitations of using a curve to fit data?

Using a curve to fit data is not always a perfect solution. It assumes that there is a mathematical relationship between the variables, which may not always be the case. Additionally, it may not accurately predict future data points if the underlying relationship between the variables changes.

5. Can the curve fitting process be automated?

Yes, there are various software programs and algorithms that can automate the curve fitting process. However, it is important for the scientist to understand the assumptions and limitations of the chosen method and to critically evaluate the results.

Similar threads

  • General Math
Replies
2
Views
686
Replies
4
Views
1K
  • General Math
Replies
1
Views
686
Replies
2
Views
1K
Replies
16
Views
2K
  • General Math
Replies
22
Views
3K
  • General Math
Replies
19
Views
1K
  • STEM Educators and Teaching
Replies
5
Views
543
Replies
1
Views
796
  • General Math
Replies
5
Views
913
Back
Top