So I spent some time with this and I was able to get it to work with adromb although there are some minor differences probably related to Laplace approximation. It is not due to the integration because I swapped out the adromb code for cumd_norm and got the same answer. From what I understand this will not work with separable functions which is a bit of an issue because it doesn't scale up nicely like the separable function. If I'm wrong about that please let me know. It would be a big improvement if the integration could be used from a separable function.<div>
<br></div><div>I've attached the tpl and dat files (they are identical) from existing example for random effect example (hnre_f2.tpl) and the adromb version of the same likelihood (inthnre_f2.tpl).  Both are based on eq 7 in <a href="https://github.com/downloads/jlaake/ADMB-Examples/distance_random_effect.pdf">https://github.com/downloads/jlaake/ADMB-Examples/distance_random_effect.pdf</a>.</div>
<div><br></div><div>Thanks for your effort here Dave. It does work as you stated and it worked great for say n<=200. If I were to take the integral into the loop for the case of covariates then the temp files get huge and become problematic.  The separable function approach is preferable and doesn't suffer from the temp file problem. So far the time being I'm left with functions like cumd_norm or internally coding an approximation.</div>
<div><br></div><div>regards--jeff</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 30, 2012 at 1:34 PM, dave fournier <span dir="ltr"><<a href="mailto:davef@otter-rsch.com" target="_blank">davef@otter-rsch.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If the model is just crashing you should be able to run it with<br>
a debugger and see at what line it happens.  Much faster than thinking.<br>
</blockquote></div><br></div>