[ADMB Users] Mixed effects on linux

Arni Magnusson arnima at hafro.is
Sun May 31 09:00:10 PDT 2009


Stig, there is a nice "hello world" example in the ADMB-RE manual, section 
2.2.1 (see attachment).

The newest compilation scripts are available at 
http://admb-project.org/community/editing-tools/admb-ide/scripts-linux.zip. 
To compile, run:

   $ admb -r simpler

Cheers,

Arni





On Sat, 30 May 2009, Stig B. Mortensen wrote:

> Hello,
>
> How do you run mixed effect models on linux with admb-re? When I look in the 
> in the manual for the mixed effects module it says that I should be able to 
> run a command like
> $ admb -re simple
> but when I look in ~/admb/bin there is no file called admb? Does the manual 
> only apply to windows or am I missing a file?
>
> I am new to admb and would just like a hello-world example with the mixed 
> models to get started.
>
> I have downloaded the admb-9.0.202-linux64-gcc4.2.4.zip  file and are able to 
> run the catage example by writing
> $ tpl2cpp catage
> $ mygcco catage
> and the running it by ./catage. I don't know how this relates to the command 
> "admb -re" that should run the mixed effects models..?
>
> /Stig
> _______________________________________________
> Users mailing list
> Users at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users
>
-------------- next part --------------
DATA_SECTION
  init_int nobs
  init_vector Y(1,nobs)
  init_vector X(1,nobs)

PARAMETER_SECTION
  init_number a
  init_number b
  init_number mu
  vector pred_Y(1,nobs)
  init_bounded_number sigma_Y(0.000001,10)
  init_bounded_number sigma_x(0.000001,10)
  random_effects_vector x(1,nobs)
  objective_function_value f

PROCEDURE_SECTION                // This section is pure C++
  f = 0;
  pred_Y=a*x+b;                  // Vectorized operations

  // Prior part for random effects x
  f += -nobs*log(sigma_x) - 0.5*norm2((x-mu)/sigma_x);

  // Likelihood part
  f += -nobs*log(sigma_Y) - 0.5*norm2((pred_Y-Y)/sigma_Y);
  f += -0.5*norm2((X-x)/0.5);
  f *= -1;  // ADMB does minimization!
-------------- next part --------------
# number of observations
10
# observed Y values
1.4  4.7  5.1  8.3  9.0  14.5  14.0  13.4  19.2  18
# observed x values
-1  0  1  2  3  4  5  6  7  8


More information about the Users mailing list