I'm having a time series and need to aproximate it with some function which is easy to calculate. It looks like the row is something like
(a*x*x + b*x + c) / (d*x + e)
Is there a way to find the coeficients automatically (with Matlab or whatever) the so that the obtained function fit series the best?
Thank you in advance!
The easiest way with Matlab (if you have the curve fit toolbox) is to use the
cftool
. This gives you a gui which you can import the data and play with the best fit.If you need to build this into a code then you can use the best function found from
cftool
usingfit
from thecurvefit
toolbox. You can define the custom function fit with something like