[ADMB Users] How to use the mcr command?

Allan Hicks allan.hicks at noaa.gov
Tue Aug 7 17:40:57 PDT 2012


Hi Edgar and Jim,

Thanks for the simple example, Jim.  I have never tried -mcr, but it is
nice to finally give it a test.  I added to your example a little bit just
to verify in my mind that you do not need to re-run the minimization, but
can start directly at the MCMC.  My appended model is:

DATA_SECTION

PARAMETER_SECTION
  init_bounded_number a(-1,2)
  sdreport_number b
  objective_function_value f
PROCEDURE_SECTION
  b=a;
  f = square(a);
  if(mceval_phase()) {
   cout << "a=" << a << endl;
  }

I then ran
program -mcmc 1000 -mcsave 100 -mcseed 3
program -mceval

to get:
a=0.600564
a=0.155787
a=0.722433
a=-0.300787
a=-0.281474
a=0.272127
a=0.238472
a=0.15326
a=0.283672
a=0.118446


I then ran:
program -mcmc 1000 -mcsave 100 -mcr -noest
program -mceval

and got:
a=0.600564
a=0.155787
a=0.722433
a=-0.300787
a=-0.281474
a=0.272127
a=0.238472
a=0.15326
a=0.283672
a=0.118446
a=-0.211523
a=-0.321766
a=1.74803
a=0.110279
a=-0.569084
a=0.299039
a=-0.118126
a=1.33894
a=0.0298129
a=-0.135164


A couple of things I learned are:
1) When using the -mcr option, you do not need to minimize again (use
-noest to save some time)
   a) and you do not need to specify any starting values using -ainp or
-binp (because it starts from the previous chain)
2) When using -mcseed, the first value is not the MLE estimate (when not
using a seed the first sample is the estimate from minimization)

Thanks again for spurring me to investigate this further and answer some
questions that I had.  Please correct me if any of my conclusions are wrong.
Allan



On Tue, Aug 7, 2012 at 5:17 PM, Jim Ianelli <jim.ianelli at noaa.gov> wrote:

> Hi,
>
> as a minimalist test I made the model:
> DATA_SECTION
>
> PARAMETER_SECTION
>   init_number a
>   sdreport_number b
>   objective_function_value f
> PROCEDURE_SECTION
>   b=a;
>   f = square(a);
>
> and invoked mcmc as:
>
> program -mcmc 1000 -mcsave 10
>
> and using readbin:
> readbin program.psv
>
> I found there was a chain of 100 elements.
>
> restarting as:
>
> program -mcr -mcmc 1000 -mcsave
>
> I got 200 elements in the chain...
>
> So it should work just to add -mcr with the previous arguments.
>
> 8 days to get 150000 MCMCs...wow.
>
> Cheers,
> Jim
>
>
> On Tue, Aug 7, 2012 at 4:58 PM, Edgar Gonzalez <edgarjgonzalez at ymail.com>wrote:
>
>> Hi everyone,
>>
>> Does anyone know how the -mcr command works? I've searched the web and
>> couldn't find its use, apart from the vague:
>>
>>  -mcr resume previous mcmc
>>
>> I ran my code (which is not a random effects model) as:
>>
>> program -mcmc 500000 -mcsave -1500
>>
>> which took about 8 days to run. My problem is that I can only run codes
>> for 10 days and then they're automatically stopped. So I'll have to
>> partition my mcmc run as I require 16 million steps (calculated from a
>> previous diagnostics run).
>>
>> Could anyone help me?
>>
>> Thanks in advance,
>>
>> Edgar J. González
>> Ecology Department
>> Science Faculty, UNAM
>>
>> _______________________________________________
>> Users mailing list
>> Users at admb-project.org
>> http://lists.admb-project.org/mailman/listinfo/users
>>
>>
>
>
> --
>
> James Ianelli
> REFM Division
> Alaska Fisheries Science Center
> NMFS/NOAA Building 4
> 7600 Sand Pt Way NE
> Seattle WA 98115
>
>  206 526 6510
>
>
>
> _______________________________________________
> Users mailing list
> Users at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20120807/b776b9bf/attachment.html>


More information about the Users mailing list