<div>Hi,</div>
<div>&nbsp;</div>
<div>You may have solved this already, but just for the record:</div>
<div>&nbsp;</div>
<div>ADMB has no special provision for finite mixture models, except that</div>
<div>its&nbsp;fast and stable&nbsp;funciton minimizer&nbsp;clearly is an advantage </div>
<div>when fitting such models. The random effects module is only for</div>
<div>continous random effects. To implement a finite mixture model</div>
<div>you have to write the C++ code directly. A simple example</div>
<div>of a Gaussian mixture is:</div>
<div>&nbsp;</div>
<div>DATA_SECTION<br>&nbsp; init_int n&nbsp;&nbsp;&nbsp;&nbsp;// Number of observations<br>&nbsp; init_vector x(1,n)&nbsp;&nbsp;&nbsp;// data <br>PARAMETER_SECTION<br>&nbsp; init_number &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p1&nbsp;&nbsp;// Mixture probabilities<br>&nbsp; init_number &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p2<br>&nbsp; init_number &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mu1&nbsp;&nbsp;// Mean values<br>
&nbsp; init_number &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mu2<br>&nbsp; objective_function_value g&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Log-likelihood<br>PROCEDURE_SECTION<br>&nbsp; for(int i=1;i&lt;=n;i++)<br>&nbsp;&nbsp;&nbsp; g += log(p1*square(x[i]-mu1)+p2*square(x[i]-mu2));<br>&nbsp; g *= -1;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // ADMB does miminization!<br>
</div>
<div>This code does not enforce the constraint p1+p2=1 or deal</div>
<div>with the identifiability issue regarding the mu&#39;s.</div>
<div>&nbsp;</div>
<div>Hans</div>
<div>&nbsp;</div>
<div>&gt;I am new to ADMB and find the approach it adopts very interesting. One thing<br>&gt;I would like to know is: does ADMB handle models in which the random effects<br>&gt;are not parameterized as continuous distributions (normal, gamma, etc.) but<br>
&gt;as discrete categories (e.g. finite mixture)? Handling finite mixture is<br>&gt;computation intensive and tends to be very slow for most statistical<br>&gt;packages; it can be a great strength (if ADMB handles it) of the unique<br>
&gt;approach adopted by ADMB.<br>&gt;<br>&gt;I would appreciate some examples, if any are available.<br>&gt;<br>&gt;Many thanks.<br>&gt;<br>&gt;Best,<br>&gt;Shige<br></div>