[ADMB Users] ADMB won't optimize model

Chris Gast cmgast at gmail.com
Thu Apr 1 12:35:55 PDT 2010


Hello,

I'm a new user to ADMB, but not to C++, R, and many other related languages.

I'm trying to fit a relatively simple fixed effects model with 10 parameters
(Windows machine, GNU compiler).  I have fit this model with a C++ program
that I have written, and obtain reasonable results--I'm confident that the
model is OK.  For that matter, I'm confident that everything in my PROCEDURE
section related to computing the negative log-likelihood is OK. I have also
verified that parameters and data are obtained correctly.  ADMB obtains the
same function value for this model and these data that I have obtained with
my own program.

The problem is this:  When I translate/compile/run my program with ADMB
("makeadm filename -est"), no optimization takes place.  The default output
indicates that 0 iterations have occurred, and repeats my initial parameter
estimates in the default table.  I wonder if someone isn't willing to take a
look and see if they can identify an issue that might be causing this?

My .tpl file is this:

DATA_SECTION
  init_int ny
  init_int na
  init_int m
  init_vector effdat(0,ny-1)
  init_int teln
  init_vector numtagged(0,teln-1)
  init_vector numrecovered(0,teln-1)
  init_imatrix dat(0,ny-1,0,na-1)

PARAMETER_SECTION
  init_vector parms(0,m-1)
  objective_function_value totL

PROCEDURE_SECTION

  int nyears=ny;
  int nages=na;
  int telnyears=teln;

  int fcohort[nyears][nages];
  int pcohort[nages-1][nages];
  int fdat[nyears+nages-1][nages];
  double auxdat[nyears][nages];
  int telyears[telnyears];
  double auxyearsum[nyears], harvyearsum[nyears];
  int i, j;
  int firsttime=0;

  ....... log-likelihood calculations

  totL=datL+auxL+telL;           //yes, totL contains the negative
log-likelihood at this point

My .pin file contains:

# parms:
520.0 443.0 534.0 356.0 291.0 270.0 106.0 0.75 0.0001 0.0001

My .dat file contains:

#nyears
5

#nages
3

# parameters
10

#effort data
50 1216 1390 1673 440

#telnyears
2

#numtagged
100 100

#numrecovered
4 12

#harvest data
2 1 1
40 33 14
37 27 22
41 13 9
4 8 2

And the resulting .par file contains:
# Number of parameters = 10  Objective function value = -121.009  Maximum
gradient component = 0.00000
# parms:
 520.000 443.000 534.000 356.000 291.000 270.000 106.000 0.750000
0.000100000 0.000100000


Thanks in advance for your help,

Chris Gast
University of Washington
Quantitative Ecology and Resource Management
cmgast at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20100401/1476bf44/attachment.html>


More information about the Users mailing list