Accurately fitting curve to data

In summary, the conversation discusses options for finding a function to accurately fit two arrays of data with high precision, including polynomial interpolation and linear or higher-order least squares approximations. Time series and autoregression models are also mentioned as potential approaches. Using a spreadsheet program such as excel may also be helpful in this process.
  • #1
komrane
1
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
  • #2
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" [Broken]. 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" [Broken] 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:
  • #3
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.
 
  • #4
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.
 

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

The purpose of fitting a curve to data is to find a mathematical function that best describes the relationship between the independent and dependent variables in a set of data. This allows for better understanding and prediction of the data, and can also help identify any patterns or trends.

2. How do you determine the best fit curve for a given set of data?

There are various methods for determining the best fit curve, depending on the type of data and the desired outcome. Some common approaches include visual inspection, least squares regression, and maximum likelihood estimation. Each method has its own advantages and limitations, so it is important to select the most appropriate one for the specific data set.

3. What are some common types of curves used for fitting data?

Some common types of curves used for fitting data include linear, polynomial, exponential, logarithmic, and power functions. The choice of curve depends on the shape of the data and the type of relationship being studied.

4. Can a curve accurately fit all types of data?

No, not all types of data can be accurately fit by a curve. If the data is highly scattered or does not follow a clear pattern, it may be difficult to find a suitable curve that accurately describes the relationship. In such cases, it may be necessary to consider other statistical methods or approaches.

5. What are some potential sources of error when fitting a curve to data?

Some potential sources of error when fitting a curve to data include measurement errors, outliers, and assumptions made about the data and the chosen curve. It is important to carefully consider these factors and their potential impact on the accuracy of the curve fit.

Similar threads

  • General Math
Replies
2
Views
687
Replies
16
Views
2K
Replies
20
Views
1K
Replies
4
Views
1K
Replies
4
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
11
Views
636
  • General Math
Replies
19
Views
1K
  • General Math
Replies
22
Views
3K
  • STEM Educators and Teaching
Replies
5
Views
546
  • Set Theory, Logic, Probability, Statistics
Replies
28
Views
2K
Back
Top