We help IT Professionals succeed at work.
Troubleshooting Question

Find a curve that fits the data

59 Views
Last Modified: 2020-10-27
What's a neat way of finding the simplest polynomial or other form of curve that fits the data.
For example the following data points:
                             
XY
00
11
25
36
46
55
63
72
81

Looking equally for an excel answer, or an online site that does it for me, ultimately I'm looking to code that in Python.
X is the input and might be any range of numbers.
Y is the output which will be between 0% and 100%

Thank you in advance
Comment
Watch Question

d-glitchResearch Engineer - Electrical
CERTIFIED EXPERT

Commented:
You need to decide what you mean by "fit".

You have nine data points.  You can define an 8th degree Lagrange Polynomial that will pass precisely through all of your points.  It is a straight forward but tedious process.  The resulting curve may behave eratically between points.
     https://en.wikipedia.org/wiki/Lagrange_polynomial

This is your data:




You can also decide to fit your data to a simpler curve, and adjust parameters to minimize the error.  Maybe something like this:
     https://en.wikipedia.org/wiki/Maxwell%E2%80%93Boltzmann_distribution



The shape of this curve is A*X² /exp(B*X² ).  In this example A =1.6 and B =0.04
nociSoftware Engineer
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
If you want to fit a curve you really need to decide on what curve to fit anyway. And then how you want to cope with "errors" ,  as you are looking for best fit.
Several methods do exist, like least difference, least squares of differences.
And decide on a single curve, of combination of curves like splines.

This article may help as you asked for an Excel example:  https://www.real-statistics.com/other-mathematical-topics/spline-fitting-interpolation/

Database Administrator / Software Engineer
CERTIFIED EXPERT
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
Thank you both, I'll look into those over the weekend.
Best wishes
Charles
Tomas Helgi JohannssonDatabase Administrator / Software Engineer
CERTIFIED EXPERT

Commented:
Hi Charles,

Do you need any more help with this?

Regards,
     Tomas Helgi

Author

Commented:
Thank you all for a helpful and insightful set of answers.
Charles

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions