[ADMB Users] a difference in estimates between versions?

Arni Magnusson arnima at hafro.is
Wed Oct 5 05:56:50 PDT 2011


To avoid confusion, here's what the version numbers mean:

   ADMB-IDE 440-2 = ADMB 9.1 (2009-12-31) for MinGW 4.4
   ADMB-IDE 450-1 = ADMB 10.0 (2011-01-20) for MinGW 4.5

This version history is documented in the 'NEWS' text file that comes with 
ADMB-IDE.

Arni



On Wed, 5 Oct 2011, Saang-Yoon wrote:

> Allen, Derek, Ian and all.
>
> As requested, I am showing an actual example.  Please note obvious 
> differences between (1) and (2) below, esp. in SE of B1.  The common TPL 
> file is shown below. DAT file has long rows.  I don't see here how to 
> attach the file.  If you need DAT file, let me your email so that I can 
> send it.
>
> Not only difference in the results, but also I am surprised that these 
> two versions differently work in response to a small change of parameter 
> bounds.  For example in the current TPL, setting the r range as 0-1 
> works in both versions, but setting it as 0-2 does NOT work in the 
> 450-1.  It is too soon to conclude, but my (limited) experience let me 
> prefer older versions prior to 450-1: e.g., 440-2. Thank you very much 
> for your response.
>
> Saang-Yoon
>
>
> (1) Results from previous version, ADMB IDE 450-1
>
> index   name   value      std dev
>     1   r   4.9970e-001 7.2940e-002
>     2   B1  8.9504e+004 1.3599e+004
>     3   K   9.1202e+004 7.9562e+003
>     4   lnq -2.1695e+000 1.9095e-001
>
>
> (2) Results from the latest version, ADMB-IDE-452-1 (64bit)
> index   name   value      std dev
>     1   r   5.0509e-001 1.4047e-002
>     2   B1  8.8638e+004 2.9544e+003
>     3   K   9.0710e+004 1.3304e+003
>     4   lnq -2.1587e+000 1.1781e-001
>
>
> ========== The following TPL was used.=============
>
> DATA_SECTION
>  int i;  //for loop;
>
>  init_vector years(1,2);
>  int nyrs;
>  int ncol;  //data column
>  !!nyrs=years(2)-years(1)+1;
>  !!ncol=3;
>
>  init_matrix yieldsurvey(1,nyrs,1,ncol);
>  vector yrs(1,nyrs);
>  vector Yt(1,nyrs);
>  vector survey(1,nyrs);  //survey data
>
>  !!yrs=trans(yieldsurvey)(1);
>  !!Yt=trans(yieldsurvey)(2);  //yield;
>  !!survey=trans(yieldsurvey)(3);
>
>  number minB1;
>  number maxB1;
>  !!minB1=Yt(1)-Yt(1)*15/100;
>  !!maxB1=minB1+minB1*3000/100;
>  //!!maxB1=sum(Yt);
>
>  number minK;
>  number maxK;
>  !!minK=max(Yt)-max(Yt)*15/100;
>  !!maxK=minK+minK*3000/100;
>  //!!maxK=sum(Yt)*10;
>
>  number minY;
>  number meanY;
>  !!minY=min(Yt);
>  !!meanY=mean(Yt);
>
>  !!cout<<"yrs: "<<yrs<<endl;
>  !!cout<<"Yt: "<<Yt<<endl;
>  !!cout<<"survey: "<<survey<<endl;
>
> PARAMETER_SECTION
>  init_bounded_number r(0.0,1.0,4);         //
>  init_bounded_number B1(minB1,maxB1,3);   //initial biomass
>  init_bounded_number K(minK,maxK,2);      //aka B_infinitive
>
>  init_number lnq(1);
>
>  vector Bt(1,nyrs+1);
>  vector adjBt(1,nyrs);
>
>  number q;
>  vector muI(1,nyrs);
>
>  number varlogI;
>
>  number MSY;
>  number Bmsy;
>  number Fmsy;
>
>  number Bpen
>
>  vector Ft(1,nyrs);
>
>  objective_function_value f;
>
> PROCEDURE_SECTION
>  f=0.0;
>  Bpen=0;
>  q=mfexp(lnq);
>
>  //Project B_t
>  Bt(1)=B1;
>  for(i=1;i<=nyrs;i++)  {
> 	 Bt(i+1)=Bt(i)+r*Bt(i)*(1-Bt(i)/K)-Yt(i);  //logistic (Schaefer)
> model
>     Bt(i+1)=posfun(Bt(i+1),meanY*2/3,Bpen);  //keeps it above
> mean(Yt)
>
>     adjBt(i)=Bt(i)-Yt(i)/2;           //Schnute
>     adjBt(i)=posfun(adjBt(i),10,Bpen); //keeps it above 10
>     }
>  f+=Bpen;
>  //cout<<"f2: "<<f<<endl;
>  //cout<<"Bt: "<<Bt<<endl;
>
>  //survey data
>  muI=q*adjBt;
>  varlogI=norm2(log(survey)-log(muI))/nyrs;  //note the analytical
> form
>
>  f+=0.5*nyrs*log(varlogI)+norm2(log(survey)-log(muI))/(2.0*varlogI);
>  //cout<<"f3: "<<f<<endl;
>
>  //management references
>
>  MSY=r*K/4;
>  Bmsy=K/2;
>  Fmsy=r/2;
>
>  Ft=elem_div(Yt(1,nyrs),Bt(1,nyrs));
>
>
> REPORT_SECTION
>  report<<"yr Yt It Bt fitIt Ft Ft/Fmsy (Bt-Yt) varlogI f"<<endl;
>  for(i=1;i<=nyrs;i++)  {
>    report<<yrs(i)<<" "<<Yt(i)<<" "<<survey(i)<<" "<<Bt(i)<<"
> "<<muI(i)<<" ";
>    report<<Ft(i)<<" "<<Ft(i)/Fmsy<<" "<<Bt(i)-Yt(i)<<" "<<varlogI<<"
> "<<f<<endl;
>  };
>  report<<"MSY, Bmsy, Fmsy: "<<MSY<<" "<<Bmsy<<" "<<Fmsy<<endl;
>  report<<"K range: "<<minK<<" "<<maxK<<endl;
>  report<<"B1 range: "<<minB1<<" "<<maxB1<<endl;
>
>
> GLOBALS_SECTION
>  #include <admodel.h>
>  #include <math.h>
>  #include <stdio.h>
>  #include <stddef.h>
>  #include <stdlib.h>
>



More information about the Users mailing list