[ADMB Users] Adjusted pow function for ADMB-RE
oliver.stirrup.13 at ucl.ac.uk
Mon Nov 24 02:48:12 PST 2014
I have found that use of the 'pow' function causes executables created by ADMB to crash when the first argument is zero, i.e. when a calculation of 0^x is attempted.
In my template files, data relating to a time variable are read into a dvar_vector and (within a loop) each element of this vector is then raised to the power of a model parameter. The time variable is positive in most cases, but occasionally takes the value of zero, leading to the problem described.
Using the standard mode for ADMB, I have overcome this problem by defining the following function to replace 'pow':
dvariable pow2(const dvariable & time, const dvariable & T)
else return pow(time,T);
I would now like to implement a similar solution for the random effects mode of ADMB, but have so far been unsuccessful in my attempts, with a large number of error messages on compilation. I think that my problem lies in the fact that I do not really understand how to define and manipulate df1b2variable objects.
If anyone can offer a solution or any advice regarding this problem, I would be very grateful.
MRC Clinical Trials Unit at UCL
Institute of Clinical Trials & Methodology
e-mail: oliver.stirrup.13 at ucl.ac.uk
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Users