7
$\begingroup$

I have a bunch of real world data sets and from manually plotting some of the data in graphs, I've discovered some data sets look pretty much logarithmic and some look linear, or exponential (and some look like a mess :).

I've been reading up on curve fitting / data fitting on wikipedia and if I understand it correctly (which I seriously doubt) I can calculate a curve of best fit using least squares calculations, but I have to determine if I want to have the curve fit a logarithm, linear or exponential (etc) pattern first.

What I would really like to do is to pass a data set into a function (I'm a programmer with poor math skills) and have that return something like "this data set looks more linear than logarithmic" or "this looks exponential".

My question is: is that even possible, without a human looking at a graph and recognizing the pattern ?

My guess is: yes. But before I invest a ton of time in figuring out how to program this, I just want to make sure I'm not barking up the wrong tree and confirm this with you guys if possible.

Sorry if this is a dumb question, but just to be clear, I'm not looking for a how-to answer, just a simple yes or no will do, however if you have suggestions on how to tackle the problem, that would be awesome of course.

  • 1
    You can do least squares interpolation using any combination of functions of your choosing.2011-04-08
  • 0
    There's even it seems a commercial solution for this: http://www.uniphiz.com/best-fit.htm though I haven't tried it. The companion program http://www.uniphiz.com/findgraph.htm can even recover the data from a plot.2011-04-08
  • 0
    Yes, I can rape the data to fit any line, but how do I know which *type* of curve 'fits best'2011-04-08
  • 0
    @lhf thanks, but I need to program it myself in php :(2011-04-08
  • 0
    @Michael: you tell which curve fits best using the least squares method. I'm not sure I understand the point of your "Yes, I can..." comment.2011-04-08
  • 0
    @Ryan Sorry, it's my lack of understanding of the least squares method that prompted that. Thanks for the pointer!2011-04-08
  • 0
    @Michael: "I can X the data to fit any line". I would never have thought if that usage for X. Is that a common or easy metaphor for 'modify a lot'? Is that what you meant?2011-04-08
  • 0
    "Interpolation" is probably not a word to use in the same sentence with "least squares". "Interpolation" means you want your curve to pass through the points, which you don't want if your points are error-infested (the reason why you're doing least squares in the first place).2011-04-10
  • 1
    @Mitch Probably mistyped "shape the data..."2018-11-13

1 Answers 1