initial point is a local minimum

4 次查看(过去 30 天)
gh
gh 2014-11-9
编辑: Matt J 2014-11-9
Dear All,
I am trying to fit a set of experimental data to a model and obtain 2 parameters. I am using "lsqcurvefit" function. I used this function for three sets of experimental data and obtain answers but for the other sets I got the below error " Initial point is a local minimum.
Optimization completed because the size of the gradient at the initial point is less than the default value of the function tolerance"
as I tried to change the initial points but it does not have any effect and it always says that the initial points are local minimum.
Can anybody help me in this matter?
function Y = myfun_D(x,F)
Y = x(1)*exp(-x(2)*F);
"x0=[5e-10,.6]; % Starting guess %
[x,resnorm] = lsqcurvefit(@myfun_D,x0,F,D)
F and D are set of data.
Best Regards Gh

回答(1 个)

Matt J
Matt J 2014-11-9
编辑:Matt J 2014-11-9
Since there are only 2 unknowns, you should be able to make a surf plot of the resnorm function to see approximately where the minimum will be. You can then use that as your initial guess for lsqcurvefit.
I suspect that you are initializing nowhere near the correct value of x(2). If x(2)*F contain very large values, the exponential on the right hand side of
Y = x(1)*exp(-x(2)*F);
will just underflow to zero and your resnorm function will look locally flat.

类别

Help CenterFile Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by