[ADMB Users] inner maxg = 0 infinite loop in ADMB-RE

dave fournier otter at otter-rsch.com
Thu Dec 23 02:33:10 PST 2010


If it is exp(eps) that is too large for the random effect you
could try bounding it with mfexp.  mfex was originally intended for
large values of x but a stndard normal should not be larger than
say 5.0 ever so


     mfexp(eps,5.0)

might do the trick. Of course you can vary this in later phases.



   dvariable mfexp(_CONST prevariable& x,double b)
   {
     if (x<=b && x>=-b)
     {
       return exp(x);
     }
     else if (x>b)
     {
       return exp(b)*(1.+2.*(x-b))/(1.+x-b);
     }
     else
     {
       return exp(-b)*(1.-x-b)/(1.+2.*(-x-b));
     }
   }



More information about the Users mailing list