0

I found several ways to do non-linear curve fitting, but all of them use modules that do the hard work, like a magic box.

I'm trying to get my hands dirt and do this curve fittings myself but I'm clueless where to start.

I made a simple script that was able to do linear fitting with a single variable. The way I did was using a while until the average difference of the output and the real data was within a margin, I updated the variable each time by 0.00001 (or something like that) +- if the difference was increasing or decreasing.

I can't do that with a multivarible non-linear curve.

Where should I start? I'm looking for video/blog/paper that goes in details on how to achieve, preferably with a non-CS view. If in Python all the better.

f.rodrigues
  • 3,499
  • 6
  • 26
  • 62
  • This can be a huge subject. One starting point is https://en.wikipedia.org/wiki/Gauss%E2%80%93Newton_algorithm. There is also a book called "Numerical Recipes" which consists largely of example code for a large variety of numerical problems. As far as I can see it contains general minimisation routines but not a routine dedicated to non-linear least squares. – mcdowella Mar 10 '17 at 05:17
  • I think what you are looking for is [Polynomial interpolation](https://en.wikipedia.org/wiki/Polynomial_interpolation) – Anand Undavia Mar 10 '17 at 05:44
  • I'm going to guess that you're looking for least-squares polynomial fitting: https://neutrium.net/mathematics/least-squares-fitting-of-a-polynomial/ There's a fair bit of math in it, I'm afraid -- you'll need to understand a bit of calculus and a bit of linear algebra. – Matt Timmermans Mar 10 '17 at 05:55
  • If you want something simple see [How approximation search works](http://stackoverflow.com/a/36163847/2521214) the links show you examples of how to use it ... – Spektre Mar 10 '17 at 09:39

0 Answers0