[ADMB Users] Function minimizer not making progress

Ian Taylor Ian.Taylor at noaa.gov
Thu Jun 2 13:44:06 PDT 2011


A link to this debugging example has been added here:
http://admb-project.org/documentation/faq#debugging
-Ian

> -----Original Message-----
> From: users-bounces at admb-project.org [mailto:users-bounces at admb-
> project.org] On Behalf Of dave fournier
> Sent: Thursday, June 02, 2011 11:54 AM
> To: users at admb-project.org
> Subject: Re: [ADMB Users] Function minimizer not making progress
> 
> On 11-06-02 10:29 AM, Toshihide Hamazaki wrote:
> 
> 
> Maybe you can write this up for the list. It is a good debugging exercise.
> 
> first one should check that the derivatives are OK.  I got rid of upper
case
> names.
> I hate them because they are treated inconsistently in various stuff.
> 
> ./kusko  -dd 0
> 
> brings up the derivative checker. entering 0 for all parameters and
> 1.e-6 for
> the step size shows   That the derivatives are wrong.
> 
> Your LL is the sum of a bunch of stuff. Easiest is to identify which part
leads to
> the incorrect LL. Here I use the first 5 parts.
> 
> change
>   //f = tf1+tf2+tf3+tf4+tf5+tf6+tf7+tf8; to this
>    f = tf1+tf2+tf3+tf4+tf5;
> 
> quick check of the derivatives shows they are OK.
> 
> so problem is in  this part
> +tf6+tf7+tf8
> 
> change to
> 
>   f = tf1+tf2+tf3+tf4+tf5+tf6+tf7;
> 
> play around a bit and you will find that tf6, 7, and 8 are all bad.
> So there is an error in that part of the code.
> 
> Open the file in vi (your favourite text editor)  or take a year off and
learn
> emacs.
> and search for tf6.  It only occurs in 3 places.
> 
>   dvariable tf1,tf2,tf3,tf4,tf5,tf6,tf7,tf8;
> 
>     tf6 += square(log(esc(Yr_tak(n)))-log(sltak*Obs_tak(n)))/wgt_Weir;
> 
>   f = tf1+tf2+tf3+tf4+tf5+tf6+tf7+tf8;
> 
> 
> et voila.  You didn't initialize tf6-8.
> 
> Also the model is badly scaled.  Pity they don't teach this stuff. Oh well
so long
> as your self esteem is high.
> You should scale your effort to have an average of 1.  Use log_q instead
of q as
> the independent variable and probably also for a bunch of other
parameters. As
> well.  afew other things and I get
> 
> # Number of parameters = 39  Objective function value = 880.399  Maximum
> gradient component = 1.49297e-05 # Tot_Run:
>   124828. 100000. 184083. 179048. 100000. 231722. 189527. 100000.
> 120630. 119154. 100000. 100000. 195827. 195979. 202405. 183813. 192496.
> 184842. 217128. 233187. 153358. 171826. 152269. 132511. 100000. 132118.
> 220728. 243343. 408677. 337317. 371276. 239961.
> # slkwe:
> 11.2369674866
> # sltul:
> 109.298494092
> # slgeo:
> 27.3164217273
> # slkog:
> 8.02980039814
> # sltat:
> 71.2398264350
> # sltak:
> 38.4125299977
> # log_q:
> -8.55912001718
> 
> thats a q of 0.00019178798954070217
> ~
> 
> You owe me $AUD 5K  (real money these days) worth of single malt.
> 
> 
> _______________________________________________
> Users mailing list
> Users at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users




More information about the Users mailing list