What is the function of this graph?

  • Context: Undergrad 
  • Thread starter Thread starter beamthegreat
  • Start date Start date
  • Tags Tags
    Function Graph
Click For Summary
SUMMARY

The discussion focuses on creating a non-linear function to fit a dataset using polynomial and spline methods. A third-order polynomial trendline in Excel was found to be inadequate for the data points provided. The recommended approach includes using higher-degree polynomials or spline functions, with R being a suitable tool for implementing spline functions. A specific formula was shared, demonstrating a method to achieve a fit with less than 1% error, emphasizing the importance of parameter tuning for optimal results.

PREREQUISITES
  • Understanding of non-linear regression techniques
  • Familiarity with polynomial functions and their degrees
  • Basic knowledge of spline functions and their applications
  • Experience with R statistical software and its libraries
NEXT STEPS
  • Explore higher-degree polynomial fitting methods in Excel
  • Learn how to implement spline functions in R using the splinefun package
  • Investigate automated parameter tuning techniques for non-linear models
  • Study the differences between polynomial and spline regression for data fitting
USEFUL FOR

Data analysts, statisticians, and researchers looking to fit complex non-linear models to datasets, particularly those interested in using R for statistical analysis and data visualization.

beamthegreat
Messages
116
Reaction score
7
I need to create a non linear function from a list of points. I tried creating a 3rd order polynomial trendline on excel but it was a very poor fit. Can anyone give me tips/advice on how to create a function that best fits the following data?

Here's what the graph looks like:

Screen_Shot_2016_09_22_at_4_19_41_AM.png
Here are the points:

63,400
63,468
63,588
63,759
63,981
64,252
64,571
64,939
65,355
65,818
66,329
66,886
67,490
68,141
68,839
69,584
70,375
71,214
72,100
73,033
74,014
75,042
76,119
77,244
78,418
79,641
80,912
82,233
83,602
85,021
86,489
88,006
89,571
91,183
92,843
94,549
96,299
98,093
99,927
101,799
103,707
105,646
107,612
109,600
111,603
113,614
115,625
117,624
119,599
121,538
123,423
125,234
126,951
128,545
129,988
131,244
132,272
133,024
133,444
133,470
133,024
132,021
130,359
127,920
124,567
120,139
114,450
107,282
98,380
87,448
74,137
58,042
38,685
15,508
 
Physics news on Phys.org
For a curve like this, there are two popular options you might want to consider. One is to allow a higher degree polynomial. To fit that curve the degree might be higher than you want. Another option is to fit it in parts with a spline function. A spline of certain orders can be pieced together so that the function and derivatives of orders up to a desired order are continuous.

There is a popular statistical package, R, that has spline function capability. (see https://stat.ethz.ch/R-manual/R-devel/library/stats/html/splinefun.html )
 
13750 * (3.6 + exp(i/17.5)) * (1-i/74.3)^0.77
Where the first element in the dataset has i=1 and the last one has i=74.

Found by black magic and sacrificing a few electrons. A spline will give better results but my formula is accurate to better than 1% apart from the last few bins. I tuned the parameters manually, an automatic approach will find a better fit.
 
  • Like
Likes   Reactions: BvU and FactChecker

Similar threads

  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 23 ·
Replies
23
Views
4K
  • · Replies 19 ·
Replies
19
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
9K