[Developers] Control files and basic MCMC
Arni Magnusson
arnima at hafro.is
Mon Jan 13 12:44:41 PST 2014
I have uploaded the pella.tpl model with data and documentation to the
http://admb-project.org/examples/fisheries
directory, next to Dave's pella-t.tpl model.
(I wrote the model several years ago and today I would handle the
Pella-Tomlinson shape parameter differently. The current implementation
does not allow Bmsy to go below 0.368K. If we ignore that unnecessary
constraint, this example is useful as a discussion platform about control
files and basic MCMC.)
To run the model, unzip the input files and try:
pella -ind hake_schaefer.dat
With this data filename, the model will automatically look for parameter
settings in hake_schaefer.ctl.
---
My point was not that all models should automatically look for a control
file - although we might opt for that in the end. Rather, my point was
that we could probably make it easier for the ADMB programmer to implement
such control files.
Lines 55-60, 64-87, and 115-120 are just a lot of repeated patterns. To a
programmer, this means that a new function that handles this general task
would make the code shorter, more readable, and less likely to have
errors.
In pseudocode, plui(logk,1,2,3,4) would set the estimation phase, lower
bound, upper bound, and initial value for that parameter, all in one
function call. This functionality would be very handy for a model with 60
parameters.
---
Less important, but easier to improve, is the fact that ADMB does not give
the programmer access to the *.dat filename. As a result, lines 47-53 are
an ugly hack to find the *.dat filename. This is a simple matter of having
ADMB export the existing variable "datname" to user scope, where it can be
useful.
---
My second point was that ADMB users deserve something prettier and more
accessible than mymodel.psv for their basic MCMC output. In other words,
text files with a header line showing column names. Lines 24, 125-126, and
171-194 show that this is currently somewhat more arduous than just typing
mymodel -mcmc. For one thing, I could see MCMC_SECTION be a synonym for
if(mceval_phase()).
Arni
More information about the Developers
mailing list