Error while using lsqnonlin

21 visualizaciones (últimos 30 días)
Khalid
Khalid el 11 de Oct. de 2015
Editada: John D'Errico el 11 de Oct. de 2015
I am using the Matlab function lsqnonlin for estimating a vector of several values. Before calling lsqnonlin, I am making a rough estimation of the 4 parameters, and afterwards the lsqnonlin is being initialized using these four parameters. The following error stops the execution:
Error using snls (line 48)
Objective function is returning undefined values at initial point. lsqnonlin cannot continue.
Error in lsqncommon (line 150)
[xC,FVAL,LAMBDA,JACOB,EXITFLAG,OUTPUT,msgData]=...
Error in lsqnonlin (line 237)
[xCurrent,Resnorm,FVAL,EXITFLAG,OUTPUT,LAMBDA,JACOB] = ...
Error in Untitled_2015 (line 53)
[x,resnorm,residual,exitflag,output,lambda,J]=lsqnonlin('myfunscwarz',thetan);
Looking forward for your suggestions !!

Respuestas (1)

Matt J
Matt J el 11 de Oct. de 2015
Editada: Matt J el 11 de Oct. de 2015
I suggest you check the value of your objective function ('myfunscwarz') at the initial point and see if the error message is accurate.
  1 comentario
John D'Errico
John D'Errico el 11 de Oct. de 2015
Editada: John D'Errico el 11 de Oct. de 2015
You say the initial values are "rough". But does your objective function even return a valid result at that point? This is a check you should make on any optimization, BEFORE you start it out.
Think of an optimizer as a poor soul that you place somewhere on the surface of the earth, then tasked with finding the deepest valley by walking downhill. If you place him in the middle of an active volcano, he may die before he ever starts searching. This is generally a bad idea. (At least give him scuba gear though, since it may get wet in that deep valley.)

Iniciar sesión para comentar.

Categorías

Más información sobre Biological and Health Sciences en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by