[ADMB Users] Random effect as finite mixture

H. Skaug hskaug at gmail.com
Sun Feb 8 00:45:36 PST 2009


You may have solved this already, but just for the record:

ADMB has no special provision for finite mixture models, except that
its fast and stable funciton minimizer clearly is an advantage
when fitting such models. The random effects module is only for
continous random effects. To implement a finite mixture model
you have to write the C++ code directly. A simple example
of a Gaussian mixture is:

  init_int n    // Number of observations
  init_vector x(1,n)   // data
  init_number        p1  // Mixture probabilities
  init_number        p2
  init_number        mu1  // Mean values
  init_number        mu2
  objective_function_value g             // Log-likelihood
  for(int i=1;i<=n;i++)
    g += log(p1*square(x[i]-mu1)+p2*square(x[i]-mu2));
  g *= -1;                                // ADMB does miminization!
This code does not enforce the constraint p1+p2=1 or deal
with the identifiability issue regarding the mu's.


>I am new to ADMB and find the approach it adopts very interesting. One
>I would like to know is: does ADMB handle models in which the random
>are not parameterized as continuous distributions (normal, gamma, etc.) but
>as discrete categories (e.g. finite mixture)? Handling finite mixture is
>computation intensive and tends to be very slow for most statistical
>packages; it can be a great strength (if ADMB handles it) of the unique
>approach adopted by ADMB.
>I would appreciate some examples, if any are available.
>Many thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20090208/bbfdafcc/attachment.html>

More information about the Users mailing list