필터 지우기
필터 지우기

will fsolve/lsqnonlin and excel solver give the same solution to non linear least squares estimation?

조회 수: 3 (최근 30일)
hi, i hope someone can clear my doubt.
I have a function S(x)= a1 exp(-exp[(x/b1)^g1]) + a2 exp(-cosh[(x/b2)^g2]). There is one constraint where a1<a2. I only have x values and S(x) values. Hence i have 6 unknown parameters to solve via non linear least squares estimation, minimising [S(x)-S(x_hat)]^2. I used Excel Solver to find an answer that converge when it is less than 1E-6. But in Matlab, what is the default where the iteration produces convergence? 1E-6? 1E-8? or something else? I have different values for the estimated parameters in both Excel and Matlab.
Thanks in advance for replying.;)

답변 (1개)

Matthias Walle
Matthias Walle 2016년 10월 6일
You can use optimoptions function to set the step size tolerance and other performance characteristics to fsolve
For instance, your code might change to:
opts = optimoptions('fsolve', 'TolFun', 1E-8, 'TolX', 1E-8);
[B,fval] = fsolve(@(b) myfun(b,x,y), b0, opts);
you can use this to compare your results.
Hope this helped you,
Matthias

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by