MATLAB Answers

Joseph
0

What is the best non-linear least square fitting method that will parameter error in addition to parameters?

Joseph
さんによって質問されました 2019 年 10 月 16 日
最新アクティビティ Joseph
さんによって 編集されました 2019 年 10 月 17 日 18:55
Hi,
I have an array A,
A=[296/296 0.08485182/0.08485182
296/463 0.070180715/0.08485182
296/681 0.055920654/0.08485182
296/894 0.042669196/0.08485182
296/1098 0.03980615/0.08485182
];
now i have fitted array A to an objective function objfcn = @(b,x) b(1).*x.^b(2) + b(3).*x.^b(4); as below:
B0 = ones(4,1);
[B,rsdnrm] = fminsearch(@(b) norm(A(:,2) - objfcn(b,A(:,1))), B0);
fprintf(1, 'c_1 = %12.6f\nc_2 = %12.6f\nn_1 = %12.6f\nn_2 = %12.6f\n', B)
and i am satisfied with the fit. However, fminsearch method does not give errors on parameters (b(1),b(2),b(3),b(4)). I tried other methods such as ''lsqnonlin'' and "lsqcurvefit ", but they do not reproduce the same parameters that i obtain from fminsearch. I was wondering if anyone knows a robust nonlinear least square fit method that is able to estimate parameter error?
Thank you all

  0 件のコメント

サインイン to comment.

1 件の回答

回答者: Star Strider
2019 年 10 月 16 日 16:13
 採用された回答

If you have the Statistics and Machine Learning Toolbox, see if the fitnlm function will do what you want. Other options are nlinfit with nlparci.

  2 件のコメント

Joseph
2019 年 10 月 17 日 17:14
Thank you for your answer.
The problem with these methods are that, even though they can estimate the parameter regression but they all only find the local minimum. obviously this may come from my initial guess, but i have no way of haveing a better intial guess so i go with B0=ones(4,1). Well in the case of fminsearch, since it's an optimization method, initial guess is not a problem, but for the non linear fit that you mentioned and they all use Levenberg–Marquardt algorithm(LMA) , it becomes a probelm, and it ends up with local minima.
Star Strider
2019 年 10 月 17 日 17:43
My pleasure.
If you prefer the fminsearch parameter estimates, use those as the initial parameter estimates for nlinfit or fitnlm. You can do the same with ga (genetic algorithm) optimisation parameter estimates, that searches the entire parameter space for the best parameter estimates.

サインイン to comment.



Translated by