0

I am trying to fit a function to data that looks like the following.

I have no idea what the function is, but by visual inspection it seems to be a parabola (or some other convex polynomial) + a scaled sinusoidal whose amplitude increases more than linearly.

I tried using a function finder from an online curve fitting tool at zunzun.com. All the functions reported by it ignore the sinusoidal component and look like a 'U'. I then tried to fit the following function but it does not result in a good fit.

 power((A*X-B),2) + C*sin(D+2*pi*X/E)*X + F

Please suggest candidate functions to fit this data. Also please suggest tools for curve fitting when the type of function is not known. Thanks for any hints. -neha enter image description here

nvk
  • 113
  • On which interval should the function fit the data, if on the whole interval how would the function continue on the rhs? – Listing Dec 12 '13 at 11:10
  • @listing: on the whole interval. I suspect on the rhs the amplitude of the oscillations keep increasing – nvk Dec 12 '13 at 11:13
  • 1
    If you don't have a mathematical model of the phenomenon (with some free parameters eventually) then anything is (im)possible. – Han de Bruijn Dec 12 '13 at 11:35
  • @Han de Brujin: I'm trying to create a mathematical model by fitting functions to observed data. – nvk Dec 12 '13 at 11:39
  • If you do not have any idea, based on a physical or mathematical model (as Han de Bruijn told), why did you choose something so complex ? Is there any reason for that choice ? – Claude Leibovici Dec 12 '13 at 11:40
  • Fitting data does not provide a model except in very few limited cases and the result can be used only for interpolation purposes. – Claude Leibovici Dec 12 '13 at 11:41
  • 1
    @Claude Leibovici: Is it really so complex? It looked to me like a sinusoid with increasing amplitude superimposed on a convex polynomial. Of course I can choose something simpler, like a straight line, but there's clearly some periodic effect there which is apparent to the eye. Can you suggest something simpler that fits the data well? – nvk Dec 12 '13 at 11:54
  • @nvk. I totally agree with you but you face here a very, very difficult problem. I think that an even simple but physically based model will be richer in terms of information. I hope and wish you succeed. I shall look at your post to see the possible progress. Cheers and good luck. – Claude Leibovici Dec 12 '13 at 11:59

2 Answers2

1

You can easily factor out the periodic part, it is robably something like $\sin(\frac{1}{40}x-K)\cdot L\exp(Mx)$. Find out $L$ and $M$ so it fits the amplitude increase (that is clearly exponential).

Once done, you will have a much simpler convex left, it's quite flat so it may be like a translation of $x^\alpha$ with $1<\alpha<2$.

rewritten
  • 3,092
  • Thanks, that function fits well. Only, the sine had to be skewed a little – nvk Dec 13 '13 at 07:19
  • @nvk. Good to hear that. Could you post a plot with the original point and the fitted curve ? This would be very interesting because it is not a very usual problem. – Claude Leibovici Dec 13 '13 at 10:15
1

Here's one possible function and the plot:

function: A polynomial to get a large 'U' + a sine whose amplitude increases as $x^4$ and a second harmonic added to the sine to make it skewed. This may not be the best solution, just one possible equation that fits reasonably well.

f(x)=P+Q*(x**3)+R*(x**2)+W*(x**4)+A*(x**5) + S*(sin(2*pi*x/(40)-T) - 0.45*sin(2*pi*x/(20)+pi/9))*(U*x**4) + V*(x**0.9) 

Curve-fitting has been done using gnuplot enter image description here

nvk
  • 113