0
votes

The documentation I am reading for curve fitting doesnt seem to be that complicated, but clearly I am doing something wrong.

Given x,y data, trying to fit a polynomial function of degree 3, the data points are seemingly ignored. Can someone explain both how to fix this, and what this curve is actually calculating, as opposed to what I think it should be calculating?

enter image description here

Data: http://pastebin.com/4EXu0FSv

1
can you show the actual data so we can reproduce the 'error'? - Benoit_11
If you're doing fitting, you probably solved for p1, p2, p3, and p4 by equating the polynomial f(x) to the value of the curve you are trying to fit at 4 points, which seems to be something like $e^{-x}$. These points seem to be about 0, 1300, 3800, and 5900. If, after solving for p1, p2, p3, and p4, the error at these points is close to zero, the fitting is probably correct. - Mr. Fegur
@Benoit_11 edited for data - user-2147482637
Looks like a reasonable fit for a third order polynomial with that data. Really I think you should try fitting an exponential or power curve to that data. - David
I can't see a fit for the same data in what you linked. Your data is nothing like a cubic polynomial, so the best fit is still a poor representation of it. - David

1 Answers

1
votes

You most likely are using the wrong regression model or interval (or points). Curve fitting is very very complex topic and can not be simply solved. Have a read of the Mathworks site about the curve fitting toolbox here .

However I would not be fitting a 3 order polynomial to this data. I would be more inclinded to fit positive reciprocal function - see if that gives you a better fit.