help-octave
[Top][All Lists]
Advanced

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

Re: nonlin_min function


From: Steph Bredenhann
Subject: Re: nonlin_min function
Date: Mon, 20 Apr 2020 11:28:11 +0200

 

On 2020/04/20 08:01, Kai Torben Ohlhus wrote:

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

Dear Kai

 

In the mean time I have read the manuals again and again and searched Google and I have made the suggested change to MaxFunEvals already, have now increased to 4000 as you suggest, see the options as I have it now.

 

GPL_options =

  scalar structure containing the fields:

    AutoScaling = off
    ComplexEqn = off
    FunValCheck = off
    FinDiffType = forward
    Jacobian = off
    MaxFunEvals =  4000
    MaxIter =  1000
    OutputFcn = [](0x0)
    Updating = off
    TolFun =  0.0000000010000
    TolX =  0.0000000010000
    TypicalX = [](0x0)

 

The outcome has now changed to:

 

fsolve outcome: GPL_info = 3:  improvement in objective function less than specified

 

As you can see I have made TolFun and TolX very small.

 

I have also changed my FUN to have a zero RHS as per the manual.

 

It seems to me that the model I am investigating just don’t have a solution with this search algorithm.

 

Thanks for your assistance, it is much appreciated.

 

--
Steph


reply via email to

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