[ADMB Users] MCMC in Windows environment

aaron jaguar.smart at gmail.com
Tue Apr 5 08:51:31 PDT 2011


Hi
On page 75 there is an example of using mcmc.
http://admb-project.org/community/admb-meeting-march-29-31/ADMBGettingStartedGuide.pdf

In the admb editor I think you want to use \C-a to pass your program 
command line options.
However, that might just be admb-mode, I use Linux.  Here is a link to 
the admb-IDE manual.
I hope that it helps.

http://admb-project.org/community/editing-tools/admb-ide/manual

Aaron

On 04/05/2011 08:38 AM, Luis Ridao wrote:
> ADMB-help,
>
> I wish to know how to run a model with MCMC on Windows.
>
> The ADMB editor I am using is Emacs (customised for Windows users -- 
> courtesy of Arni Magnuson)
>
> The model is the well known Ricker S-R with an extra covariate:
> ###########
> GLOBALS_SECTION
>   #include "admodel.h"
>   const double pi = 3.141592654;
>   ofstream mcmc_par("ricker2massb_mcmc.csv")
>
> DATA_SECTION
>   init_int n
>   init_matrix data(1,n,1,3)
>   vector S(1,n)
>   !! S = column(data,1);
>   vector R(1,n)
>   !! R = column(data,2);
>   vector massb(1,n)
>   !! massb = column(data,3);
> PARAMETER_SECTION
>   init_number a
>   init_number b
>   init_number c
>   init_number logSigma
>   sdreport_number sigma
>   vector Rfit(1,n)
>   number RSS
>   objective_function_value f
>
> INITIALIZATION_SECTION
>   a 0.6
>   b -4.0
>   c -1.1
>   logSigma -1
> PROCEDURE_SECTION
>   Rfit = exp(a) * elem_prod(S, exp(-exp(b)*S+exp(c)*massb));
>   RSS = sum(square(log(R)-log(Rfit)));
>   sigma = exp(logSigma);
>   f = 0.5*n*log(2*pi) + n*logSigma + RSS/(2.0*square(sigma));
>   if(mceval_phase())
>   write_mcmc();
>
> FUNCTION write_mcmc
>   mcmc_par << a << "," << b << "," << c << endl;
> ###################
>
> Thanks in advance,
> Luis
>
>
> _______________________________________________
> 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/20110405/4d68e9d4/attachment.html>


More information about the Users mailing list