MATLAB: How to apply a model to a dataset and calculate coefficients using non-linear regression

non-linear regression

The problem is attached, and I'm just not sure how to calculate the coefficients. Do I use polyfit?
Can someone show me what to do?

Best Answer

You could possibly use polyfit by setting ‘x=1/m’ and regressing against exp(G), then re-transforming it later. Such transformations are generally to be avoided, because they also transform the errors, and lead to inaccurate parameter estimates.
However, I get the impression that the assignment wants you to use fminsearch, nlinfit, or lsqcurvefit. You can easily code the regression as an anonymous function to use with these optimisation functions:
G_fcn = @(B,m) log(B(1)./(m.^2) + B(2)./m + B(3));
I tested this with nlinfit and your data and got a good fit. Since this is your assignment, I leave the rest to you.
Related Question