I have the following data in my thesis:
28 45
91 14
102 11
393 5
4492 1.77
I need to fit a curve into this. If I plot it, then this is what I get.
I think some kind of exponential curve should fit this data. I am using GNUplot. Can someone tell me what kind of curve will fit this and what initial parameters I can use?
Just in case R is an option, here's a sketch of two methods you might use.
First method: evaluate the goodness of fit of a set of candidate models
This is probably the best way as it takes advantage of what you might already know or expect about the relationship between the variables.
The orange curve looks pretty good. Let's see how it ranks when we measure the relative goodness of fit of these models are...
Second method: use genetic programming to search a vast amount of models
This seems to be a kind of wild shot in the dark approach to curve-fitting. You don't have to specify much at the start, though perhaps I'm doing it wrong...
Actually a very poor visual fit. Perhaps there's a bit more effort required to get quality results from genetic programming...
Credits: Curve fitting answer 1, curve fitting answer 2 by G. Grothendieck.
Do you know some analytical function that the data should adhere to? If so, it could help you choose the form of the function, to fit to the data.
Otherwise, since the data looks like exponential decay, try something like this in gnuplot, where a function with two free parameters is fitted to the data:
Gnuplot will vary parameters named after the 'via' clause for the best fit. Statistics are printed to stdout, as well as a file called 'fit.log' in the current working directory.
The c variable will determine the curvature (decay), while the b variable will scale all values linearly to get the correct magnitude of the data.
For more info, see the Curve fit section in the Gnuplot documentation.