how to use optimization options?

12 views
Skip to first unread message

jokar....@gmail.com

unread,
Mar 26, 2020, 8:51:11 PM3/26/20
to ADMB Users

I have written very simple ADMB code bellow and I want to change the default optimization method to be for example ‘lmn N’ or 'lmn2 N'.

 

DATA_SECTION

PARAMETER_SECTION

  init_number x;

  init_number y;

  objective_function_value f

PROCEDURE_SECTION

  f = 100*(y-x*x)*(y-x*x)+(1 - x)*(1 - x);

 

Can someone please help me how can I change the optimization method and also how can I change the accuracy (tol = 10^-8) for stopping the optimization algorithm?


Ian Taylor - NOAA Federal

unread,
Mar 27, 2020, 5:52:35 PM3/27/20
to jokar....@gmail.com, ADMB Users
Hi Mohmod,
In addition to the command line input "-crit 0.0001", you can hardwire the convergence criterion in your TPL file by adding something like 
RUNTIME_SECTION
  maximum_function_evaluations 20000
  convergence_criteria 1.e-6 
to the end of your TPL file as shown in the example TPL files included with ADMB under /examples/admb/buscycle/, e.g. https://github.com/admb-project/admb/blob/master/examples/admb/buscycle/ham4.tpl#L223-L225. The convergence_criteria can be different for each phase if you use multiple estimation phases and can be modified based on values in an input file.

I'm not aware of a way to specify the optimization algorithm directly in the TPL file as opposed to appending something like "-lmn N" to the command line call to your compiled TPL code. But others on this list would know better than me.
-Ian
 


--
To unsubscribe from this group and stop receiving emails from it, send an email to users+un...@admb-project.org.

Ian Taylor - NOAA Federal

unread,
Mar 27, 2020, 7:39:23 PM3/27/20
to Mahmood Jokar, ADMB Users
Hi Mahmood,
Sorry if I misunderstood, but if you are having trouble with the command line options listed in Chapter 12, here is a typical example use assuming your code was saved as a file test.tpl 
compile the code:
> admb test
run no additional arguments:
> test
run with some common additional arguments:
> test -nox -nohess
run with limited memory quasi newton algorithm:
> test -lmn 10

I'm not familiar with the -lmn option but the example above changes the reported number of function evaluations in the optimization, so I assume it's working. You could add some code to report the parameter values during each step in the optimization to better understand how the choice of algorithm is impacting the optimization process.
-Ian

On Fri, Mar 27, 2020 at 4:15 PM Mahmood Jokar <jokar....@gmail.com> wrote:
Hi Ian,
Thanks, that's very helpful ! 
In chapter 12 of the ADMB manual  several options like "-lmn N" are mentioned which can be used in command line, but unfortunately I didn't figure out how that's possible.
I'll wait for others who may know this.
Mahmood
Reply all
Reply to author
Forward
0 new messages