Accurately fitting curve to data

  • Context: Undergrad 
  • Thread starter Thread starter komrane
  • Start date Start date
  • Tags Tags
    Curve Data Fitting
Click For Summary

Discussion Overview

The discussion revolves around the challenge of fitting a function to a set of data points represented by two arrays, X and Y. Participants explore various methods for achieving high precision in curve fitting, including polynomial interpolation and least squares approximations, while considering the nature of the data as potentially representing a time series.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant requests assistance in finding a function to fit their data with high precision.
  • Another participant suggests that the definition of "accuracy" is crucial and proposes using a 102nd degree polynomial for exact interpolation, noting the availability of tools like Matlab or Octave for this purpose.
  • A different viewpoint introduces the idea of seeking the best linear approximation or higher-order least squares approximations, emphasizing the importance of defining "accurate."
  • One participant speculates that the data may represent a time series and recommends researching autoregression models or ARIMA models as potential fitting methods.
  • Another participant mentions the use of spreadsheet programs like Excel, which have built-in functions for curve fitting, suggesting that testing these could help determine the degree of precision.

Areas of Agreement / Disagreement

Participants express differing opinions on the best approach to fitting the data, with no consensus on a single method or definition of accuracy. Multiple competing views remain regarding the appropriate techniques for curve fitting.

Contextual Notes

Participants have not resolved the specific assumptions regarding the definition of accuracy or the nature of the data, which may influence the choice of fitting method.

komrane
Messages
1
Reaction score
0
Hi everyone,
I want to find a function to fit a two arrays data (X,Y=f(X)) with high precision, but I am not succeed.
Can anyone help me.
These are my data:
X={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,
33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,
62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
91,92,93,94,95,96,97,98,99,100,101,102,103};
Y={-3.82047923,-4.78741509,-3.7235349,-3.83978508,-4.05577459,-4.30089612,-4.533835,
-4.74829898,-4.94488133,-5.12552735,-4.85195336,-4.7612524,-4.68355948,-4.69161082,
-4.73528276,-4.79596239,-4.86512986,-4.93839307,-4.76858464,-4.6914727,-4.75906268,
-4.83409367,-4.91083489,-5.06679286,-5.06287703,-5.13691706,-5.20911926,-5.27953551,
-5.41696518,-5.38100772,-5.41533957,-5.37176179,-5.37544389,-5.38749604,-5.40564269,
-5.42796115,-5.31359172,-5.24494792,-5.24966838,-5.26982538,-5.33876087,-5.36920739,
-5.40155805,-5.43522901,-5.47070746,-5.55225881,-5.54130792,-5.53404017,-5.50585981,
-5.49365225,-5.48926542,-5.4907033,-5.49650191,-5.50562495,-5.42179559,-5.36756524,
-5.36483956,-5.43302415,-5.46809702,-5.5035703,-5.53917246,-5.57474765,-5.61100546,
-5.61535429,-5.6811938,-5.71600271,-5.75053965,-5.78479005,-5.81874653,-5.85240181,
-5.8537986,-5.86366491,-5.87645036,-5.89129497,-5.90794966,-5.92512355,-5.94314335,
-5.98374099,-6.00311053,-6.00091604,-5.97752754,-5.96422759,-5.95638692,-5.9523968,
-5.95137799,-5.95274728,-5.89262269,-5.85051099,-5.83581257,-5.83046564,-5.86806419,
-5.88735021,-5.90739448,-5.95040446,-5.97217823,-5.97055505,-5.99290744,-6.03952233,
-6.06244391,-6.08579093,-6.10898718,-6.1322644,-6.12755437}.

Thanks a lot in advance
 
Mathematics news on Phys.org
Be a little more precise...what is your exact definition of accuracy? I see that you have 103 data points, so you could come up with a 102nd degree polynomial that goes through every one of those points exactly using http://en.wikipedia.org/wiki/Polynomial_interpolation" . All this would take is a bit of time for you to enter your data into a linear algebra program such as Matlab or Octave.

On the other hand, if you want the best linear approximation of that function you could consider http://en.wikipedia.org/wiki/Linear_least_squares" or higher-order least squares approximations.

It all depends on your definition of "accurate" and what kind of curve you want to fit.
 
Last edited by a moderator:
Given that the X is simply a count, I presume this is a time series. It might be interesting to read/google about autoregression models or ARIMA models.
 
If you have access to a spreadsheet program such as excel, they contain functions for this purpose. You would have to try them to test for the degree of precision.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
Replies
6
Views
1K
  • · Replies 28 ·
Replies
28
Views
3K
  • · Replies 19 ·
Replies
19
Views
7K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 4 ·
Replies
4
Views
6K