ISEC2012 International Statistical Ecology Conference

This conference will convene experts from around the world to present and discuss issues of interest to ecological statisticians and biologists. Pre-conference workshops will take place 30 June – 3 July.

See on www.cees.uio.no and  Scoop.it – Fisheries modelling

Advertisements

Using C++ directives to make ADMB report file

One way to get output from ADMB is making a suitable encode REPORT_SECTION, allowing custom output of the model result. However, when your model have hundreds of output, declare each one can be a repetitive task. Recently, I was exploring ADMB repositories and I got a nice option, provided by Steve Martell, that make use of C++ directives.

Consider this simple linear regression model (data gist):

DATA_SECTION
 init_int nobs
 init_matrix data(1,nobs,1,2)
 vector x(1,nobs)
 vector y(1,nobs)

PARAMETER_SECTION
 init_number a(1)
 init_number b(2)
 objective_function_value f
 LOCAL_CALCS
   x = column(data,2);
   y = column(data,1);
 END_CALCS

PROCEDURE_SECTION
 f=0;
 for (int i=1;i<=nobs;i++)
    {
     f+=square(y(i)-(a+b*x(i)));
    }

REPORT_SECTION
 report << "rss: " << f << endl;
 report << "data: " << data << endl;

Note that REPORT_SECTION have two lines with repetitive code. Using both #undef and #define C++ directives, you can save a lot of encode, principally if your model is multiparametric like most fisheries stock assessment models. All you need to do is add the following lines into the GLOBALS_SECTION and modify the REPORT_SECTION according to C++ directives:


GLOBALS_SECTION
 #undef myReport
 #define myReport(object) report << #object "\n" << object << endl;

DATA_SECTION
 init_int nobs
 init_matrix data(1,nobs,1,2)

PARAMETER_SECTION
 ....
 ....
 ....

REPORT_SECTION
 myReport(x);
 myReport(f);

Enjoy!!!

Biological Reference Points

The status of a particular resource is found by calculating a variable that represent the accumulated fishing history and comparing it with the biological reference point. The biological reference point is not a fishery management objective; rather it is an attempt to indicate the location of a biological constraint on resource productivity and resilience. This presentation briefly reviews the development and application of biological reference points in some Chilean Fisheries.