[ADMB Users] adpool unit size error

dave fournier davef at otter-rsch.com
Sat Jul 5 20:38:34 PDT 2014


this message got mixed up with the stupid google groups version.  a pox 
on all that stuff.



When the software was first being built the compiler and their class 
type matching rules were different fomr compiler to
compiler and from version to version.  this led to a lot of useless and 
boring complexity.  Anyway the rule
of thumb is for  conditional statements like

    if (a<b)
      ....

use

   if (value(a)<value(b))
      ...

and you can't go wrong.

For variable arithmetic where you are expecting derivative calculations  
like

       x = y+2.0*z;

*NEVER* use

   value(x) = value(y+2.0*z);

because even if it seems to work the derivatives will be wrong.


Otherwise, ADMB assumes that your objective function is differentiable.

when you use something like

       if (value(x)<a)
          y=f(x);
       else
          y=g(x);

the resulting calculation will generally not be differentiable at a even 
if f(a)=g(a)

My general approach to this is to paste the two functions together with 
say cubic splines over the
interval  (a-eps,a+eps) for small adjustable eps.



More information about the Users mailing list