[ADMB Users] ADMB development cycle (bug in file f1b2vc1)

Schnute, Jon Jon.Schnute at dfo-mpo.gc.ca
Mon Aug 17 19:04:18 PDT 2009


We've had some excellent exchanges among ADMB users recently. In
particular, according to a message from Dave on August 6 (attached at
the bottom of this message), Ben found a fatal bug. A few days later
(August 10), Johnoel announced the release of ADMB 9.0.363 with "various
fixes to the libraries". I made the assumption that this bug had
probably been fixed, so I thought I'd check the status of the code at
http://code.google.com/p/admb-project/. In particular, I looked at the
file f1b2vc1.cpp, located at:

http://code.google.com/p/admb-project/source/browse/trunk/df1b2-separabl
e/f1b2vc1.cpp

According to the SVN log on this file, it hasn't changed since release
43 on March 31. Also, it appears not to include Dave's suggestion about
ADUNCONST(dvector,x).

So my question is this: How does the source code site
http://code.google.com/p/admb-project/ fit into the ADMB development
cycle? Also, how would I actually build a version of ADMB from the files
in the trunk subdirectories: df1b2-separable, examples, LICENSE,
linad99, nh99, and tools99?

I've used SVN to build and track my own local version of the source
files, but I see from the change log at:

http://code.google.com/p/admb-project/source/list 

that all changes since release 43 have pertained to the Wiki.

Probably, I've failed to notice an explanation somewhere of how all this
should work, and I suspect that the Google code site is still in
development. But I know from my own recent experience that the tools
available at "Google code" can greatly facilitate project development.
Perhaps the ADMB user community would explore some of the changes Ben
discussed if they/we had a full understanding of the complete toolkit
needed to build ADMB from the latest source code.

Thanks,
Jon

******************************************
Jon Schnute
Pacific Biological Station
3190 Hammond Bay Road
Nanaimo, BC V9T 6N7
CANADA

NEW email: Jon.Schnute at dfo-mpo.gc.ca 
 (formerly schnutej at pac.dfo-mpo.gc.ca)
******************************************

-----Original Message-----
From: users-bounces at admb-project.org
[mailto:users-bounces at admb-project.org] On Behalf Of dave fournier
Sent: August-06-09 8:30 AM
To: users at admb-project.org
Subject: [ADMB Users] bug in file f1b2vc1


Thanks Ben you found a fatal bug. Hard to believe that function had
never been used before. In the file f1b2vc1.cpp
the line

      ADUNCONST(df1b2vector,x)

should have been

    ADUNCONST(dvector,x)



df1b2vector operator + (const dvector& _x,const df1b2vector& _y)
  {
    ADUNCONST(df1b2vector,x)

   ADUNCONST(df1b2vector,y)

   check_shape(x,y,"operator +");


   int mmin=x.indexmin();

   int mmax=x.indexmax();

   df1b2vector tmp;

   tmp.noallocate(mmin,mmax);


   for (int i=mmin;i<=mmax;i++)
    {

     tmp(i)=x(i)+y(i);
    }

   return tmp;

 }


Sorry for that.  The reason for these stupid errors is that every once
and a while the  compiler police for the various c++ compilers make
changes that break huge amount of old code so one has to fix it all at
one go and these sorts of errors  creep in.

Maybe someone can comment on how this can get fixed quickly.

as for just hoping that prob will remain between 0 and 1 -- that is a
mugs game. It will break at the most inopportune time. I modifed your
code to put in the bounds. also you need to include the prior for the
u's

Finally WRT yuo commentabout initial values for the u's being necessary.
that is inaccurate. default values are provided for all parameters.
However if you want to supply a *.pin ifle then it must include values
for all parameters. I have already commented on the easiest way to
produce such a *.pin file.

Herre is your code as I have modified it.

 //cout << "cvec calc\n";
 cvec = sigma_c*(Z*u)+c;
 a1vec = elem_prod(pow(size/d,g),exp(-size/d));
 //cout << "prob calc\n";
 prob = 1/(1/(elem_prod(cvec,a1vec))+h*initial);

 dvariable ppen=0.0;
 dvar_vector pprob=posfun(prob,0.01,ppen);
 f+=ppen;

 ppen=0.0;

 dvar_vector pprob2=1.0-posfun(1.0-pprob,0.01,ppen);

 f+=ppen;

 f+=0.5*norm2(u);  // prior

 f -= sum( log_comb(initial,killed)+
          elem_prod(killed,log(pprob2))+
          elem_prod(initial-killed,log(1-pprob2)));





-- 
David A. Fournier
P.O. Box 2040,
Sidney, B.C. V8l 3S3
Canada
Phone/FAX 250-655-3364
http://otter-rsch.com
_______________________________________________
Users mailing list
Users at admb-project.org
http://lists.admb-project.org/mailman/listinfo/users



More information about the Users mailing list