help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nonlin_min function


From: Kai Torben Ohlhus
Subject: Re: nonlin_min function
Date: Mon, 20 Apr 2020 15:01:10 +0900
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 4/9/20 4:56 AM, Steph Bredenhann wrote:
> 
> I have now abandoned *nonlin_min* and rather use *fsolve*, see attached
> edited .m files
> 
> The output is and seems quite good, will test further:
> 
> GPL parameters:
> D0 = 0.000557218
> D1 = 0.000053334
> m  = 0.399999
> GPL_RMSE  = 1.096952
> fsolve outcome: GPL_cvg = 0:  maximum number of iterations exceeded  
> Iterations = 75
> 
> As you can see fsolve terminate with maximum iterations exceeded.
> Iterations reported = 75, however the fsolve default is 400 and although
> I increased MaxIter to 1000 the outcome stays the same. I assume the
> tolerances were met, but I still try to understand the tolerances, I
> work with defaults.
> 
> Any comments/improvements will be appreciated.
> 
> 
> -- 
> */Steph/*


Dear Steph,

Sorry for the late reply.  Regarding your first question you should
carefully read the manual [1].  The returned value "0" has two meanings [1]:

    "Iteration limit (either MaxIter or MaxFunEvals) exceeded."

You only increased "MaxIter", but "MaxFunEvals" reaches its default
value "100 * number_of_variables", "300" in your case, earlier.  You can
set this value in your script by adding:

    GPL_options = optimset ("fsolve");
    GPL_options.MaxIter = 1000;
    GPL_options.MaxFunEvals = 4000;


In general, fsolve() is an m-file, thus easy to debug and step through.
 Just set a breakpoint in your call_script.m, where fsolve() is called
and choose "step-in" to see what Octave is doing step-by-step.

HTH,
Kai

[1] https://octave.org/doc/v5.2.0/XREFfsolve.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]