calculate goodness of fit
26 views (last 30 days)
I have a data set which looks like this
I have around 7 equations like
y=atp*kcat*Et.*x ./ (kd_A*km_g + km_g*atp + km_a*x + atp*x.*(1+x./ksi));
y=atp*kcat*E.*x ./ (km_g*atp + km_a*x.*(1+x./ksi) + atp*x);
There are 4 - 5 parameters to fit for in each equation and there are 3 - 4 known variables.
One of these equations should be the best fit for the data and I want to find that. I tried using lsqcurvefit and got pretty good results. But similar values fpr the variables using all the equations and the resnorm is identical. Is there a way to find the goodness of fit? And am I doing it correct?
Star Strider on 20 Feb 2014
Edited: Star Strider on 20 Feb 2014
If you have the Statistics Toolbox, I suggest fitnlm. It produces a number of useful statistics. To the best of my knowledge, these aren’t available with lsqcurvefit and the Optimization Toolbox.
As a general rule, if all your functions produce similar residual errors, the model with the fewest parameters to estimate will have the best goodness-of-fit because it has the greatest degrees-of-freedom. The F-statistic may be the best measure, although the likelihood ratio may be best for for comparing two models with the same number of parameters.
That said, there are a number of other techniques to assess regression models. It is too broad a subject to go into here.
More Answers (2)
jandas on 20 Feb 2014
Try to use the fit function
[fitobject,gof] = fit(x,y,fitType)
and have a look at the gof output argument
Matt J on 21 Feb 2014
Edited: Matt J on 21 Feb 2014
You could use curve fitters from other toolboxes as the others have been telling you. On the other hand, the goodness of fit measures that they return are rather simple functions of the output residual vector and Jacobian that lsqcurvefit does give you. You could easily calculate the goodness of fit metrics yourself.